vail

Internet morse code repeater
git clone https://git.woozle.org/neale/vail.git

vail / .github / workflows
Neale Pickett  ·  2022-03-31

build.yaml

 1name: Build/Push
 2
 3on:
 4  push:
 5    branches:
 6      - main
 7      - master
 8    tags:
 9      - v*
10
11jobs:
12  publish:
13    name: Publish container images
14    runs-on: ubuntu-latest
15    permissions:
16      contents: read
17      packages: write
18    steps:
19      - name: Retrieve code
20        uses: actions/checkout@v2
21
22      - name: Gitlab variables
23        id: vars
24        run: build/gitlab-vars
25
26      - name: Login to GitHub Packages Docker Registry
27        uses: docker/login-action@v1
28        with:
29          registry: ghcr.io
30          username: ${{ github.actor }}
31          password: ${{ secrets.GITHUB_TOKEN }}
32
33      - name: Set up QEMU
34        uses: docker/setup-qemu-action@v1
35
36      # Currently required, because buildx doesn't support auto-push from docker
37      - name: Set up builder
38        uses: docker/setup-buildx-action@v1
39        id: buildx
40
41      - name: Extract metadata (tags, labels) for Docker
42        id: meta
43        uses: docker/metadata-action@v2
44        with:
45          images: |
46            ghcr.io/${{ github.repository }}            
47
48      - name: Build and push image
49        uses: docker/build-push-action@v2
50        with:
51          builder: ${{ steps.buildx.outputs.name }}
52          file: build/Dockerfile
53          push: true
54          platforms: linux/amd64
55          tags: ${{ steps.meta.outputs.tags }}
56          labels: ${{ steps.meta.output.labels }}