]> git.madduck.net Git - etc/vim.git/blob - .github/workflows/docker.yml

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

8baace940ba6079790c4d59a56ee87ae43ab1219
[etc/vim.git] / .github / workflows / docker.yml
1 name: docker
2
3 on:
4   push:
5     branches:
6       - "main"
7   release:
8     types: [published]
9
10 permissions:
11   contents: read
12
13 jobs:
14   docker:
15     if: github.repository == 'psf/black'
16     runs-on: ubuntu-latest
17     steps:
18       - name: Checkout
19         uses: actions/checkout@v3
20
21       - name: Set up QEMU
22         uses: docker/setup-qemu-action@v2
23
24       - name: Set up Docker Buildx
25         uses: docker/setup-buildx-action@v2
26
27       - name: Login to DockerHub
28         uses: docker/login-action@v2
29         with:
30           username: ${{ secrets.DOCKERHUB_USERNAME }}
31           password: ${{ secrets.DOCKERHUB_TOKEN }}
32
33       - name: Check + set version tag
34         run:
35           echo "GIT_TAG=$(git describe --candidates=0 --tags 2> /dev/null || echo
36           latest_non_release)" >> $GITHUB_ENV
37
38       - name: Build and push
39         uses: docker/build-push-action@v4
40         with:
41           context: .
42           platforms: linux/amd64,linux/arm64
43           push: true
44           tags: pyfound/black:latest,pyfound/black:${{ env.GIT_TAG }}
45
46       - name: Build and push latest_release tag
47         if:
48           ${{ github.event_name == 'release' && github.event.action == 'published' &&
49           !github.event.release.prerelease }}
50         uses: docker/build-push-action@v4
51         with:
52           context: .
53           platforms: linux/amd64,linux/arm64
54           push: true
55           tags: pyfound/black:latest_release
56
57       - name: Build and push latest_prerelease tag
58         if:
59           ${{ github.event_name == 'release' && github.event.action == 'published' &&
60           github.event.release.prerelease }}
61         uses: docker/build-push-action@v4
62         with:
63           context: .
64           platforms: linux/amd64,linux/arm64
65           push: true
66           tags: pyfound/black:latest_prerelease
67
68       - name: Image digest
69         run: echo ${{ steps.docker_build.outputs.digest }}