Skip to content

Commit

Permalink
Publish image for tags as well
Browse files Browse the repository at this point in the history
  • Loading branch information
skorfmann committed Jun 28, 2023
1 parent 1a109f8 commit dd4f4bd
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths-ignore:
- '**/*.md'
branches: [ main ]
tags: [ '*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -19,14 +20,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
-
name: Login to GitHub Container Registry

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: winglang
password: ${{ secrets.GITHUB_TOKEN }}
- run: |

- name: Build and push
run: |
docker build -t wing-action .
docker tag wing-action ghcr.io/winglang/wing-github-action:main
docker push ghcr.io/winglang/wing-github-action:main
# For main branch, tag it as 'main'
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
docker tag wing-action ghcr.io/winglang/wing-github-action:main
docker push ghcr.io/winglang/wing-github-action:main
fi
# For new tags, tag the docker image with the same tag
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
docker tag wing-action ghcr.io/winglang/wing-github-action:$TAG
docker push ghcr.io/winglang/wing-github-action:$TAG
fi

0 comments on commit dd4f4bd

Please sign in to comment.