-
Notifications
You must be signed in to change notification settings - Fork 3
30 lines (30 loc) · 953 Bytes
/
image-release.yaml
File metadata and controls
30 lines (30 loc) · 953 Bytes
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: release image
on:
push:
tags:
- 'image-v*' # push events for tags matching image-v for version (image-v1.0, etc)
permissions:
contents: read
packages: write
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set env
run: echo "RELEASE_VERSION=${GITHUB_REF:17}" >> $GITHUB_ENV # refs/tags/image-v1.0.0 substring starting at 1.0.0
- name: setup buildx
uses: docker/setup-buildx-action@v1
- name: login to GitHub container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/packtpublishing/tweeter:${{ env.RELEASE_VERSION }}
ghcr.io/packtpublishing/tweeter:latest