-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 1.06 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
name: Deploy versioned & latest
on:
release:
types: [published]
jobs:
deploy-base:
name: Deploy base image
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.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: docker build -t ghcr.io/microbit-foundation/daplink:latest .
- name: Tag same base image with the versioned tag
run: docker tag ghcr.io/microbit-foundation/daplink:latest ghcr.io/microbit-foundation/daplink:${{ steps.get_version.outputs.VERSION }}
- name: Push images and tags to ghcr.io
run: |
docker push ghcr.io/microbit-foundation/daplink:${{ steps.get_version.outputs.VERSION }}
docker push ghcr.io/microbit-foundation/daplink:latest