Add get tags removed by mistake #237
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test && Build && Push | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- scilog/** | |
- .github/workflows/test-build-push.fe.yaml | |
push: | |
branches: [main] | |
paths: | |
- scilog/** | |
- .github/workflows/test-build-push.fe.yaml | |
release: | |
types: [published] | |
paths: | |
- scilog/** | |
- .github/workflows/test-build-push.fe.yaml | |
env: | |
CONTAINER_REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }}/fe | |
CONTEXT: scilog | |
jobs: | |
test: | |
name: Test and build image on PR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Test | |
if: github.event_name != 'push' | |
run: | | |
cd $CONTEXT | |
docker compose -f docker-compose.test.yaml up --build --no-deps --abort-on-container-exit --exit-code-from scilog | |
docker compose -f docker-compose.test.yaml down | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
if: github.event_name != 'pull_request' | |
with: | |
registry: ${{ env.CONTAINER_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract tags | |
id: tags | |
run: | | |
prefix=$CONTAINER_REGISTRY/$IMAGE_NAME | |
tags=$prefix:"${{ github.sha }}" | |
if [[ "${{ github.event_name }}" == "release" ]]; then | |
tags=$prefix:"${{ github.event.release.tag_name }}",$prefix:stable | |
fi | |
echo "tags=$tags,$prefix:latest" >> $GITHUB_OUTPUT | |
- name: Build | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ env.CONTEXT }}/. | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.tags.outputs.tags }} |