-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (36 loc) · 1.15 KB
/
tag.yaml
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
37
38
39
40
41
42
name: Publish Docker image
on:
push:
tags:
- '**'
jobs:
push_to_registry:
runs-on: ubuntu-latest
steps:
- name: Extract Tags
id: tags
run: |
IMAGE_VERSION="${GITHUB_REF/refs\/tags\//}"
TAGS="ghcr.io/inshur/fy:$IMAGE_VERSION"
echo "IMAGE_VERSION=${IMAGE_VERSION}" >> ${GITHUB_ENV}
echo "TAGS=${TAGS}" >> ${GITHUB_ENV}
echo $TAGS
echo ::set-output name=tags::${TAGS}
- name: Check out repo
uses: actions/checkout@v2
- 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.GHCR_PAT }}
- name: Push to GitHub Packages
uses: docker/build-push-action@v2
with:
context: .
push: true
# failing to use a variable here for some reason:
# Error: buildx call failed with: invalid tag "${TAGS}": invalid reference format
#tags: inshur/fy:latest
tags: ${{ steps.tags.outputs.tags }}