-
Notifications
You must be signed in to change notification settings - Fork 6
36 lines (34 loc) · 1.91 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Deploy versioned & latest
on:
release:
types: [published]
jobs:
deploy-release:
name: Deploy versioned images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build base image (expanded disk) with latest tag
run: docker build -t ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:bullseye-latest --build-arg FILE_SUFFIX=autologin-ssh-expanded .
- name: Tag the base image with the versioned tag
run: docker tag ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:bullseye-latest ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:${{ steps.get_version.outputs.VERSION }}
- name: Build Reduced Disk image
run: docker build -t ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:${{ steps.get_version.outputs.VERSION }}-reduced-disk --build-arg FILE_SUFFIX=autologin-ssh .
- name: Build Mu image
run: docker build -t ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:${{ steps.get_version.outputs.VERSION }}-mu --build-arg FILE_SUFFIX=mu .
- name: Push images to ghcr.io
run: |
docker push ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:${{ steps.get_version.outputs.VERSION }}-mu
docker push ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:${{ steps.get_version.outputs.VERSION }}-reduced-disk
docker push ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:${{ steps.get_version.outputs.VERSION }}
docker push ghcr.io/${{ github.repository_owner }}/qemu-rpi-os-lite:bullseye-latest