Skip to content

Merge pull request #72 from zaanposni/dependabot/npm_and_yarn/src/ima… #60

Merge pull request #72 from zaanposni/dependabot/npm_and_yarn/src/ima…

Merge pull request #72 from zaanposni/dependabot/npm_and_yarn/src/ima… #60

name: DockerPublish
on:
push:
branches:
- "master"
jobs:
DockerPublish:
if: github.repository_owner == 'zaanposni'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Determine version
run: |
VERSION=$(cat ./src/psaggregator/package.json | jq -r '.version')
echo "I found version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build frontend
working-directory: ./src/psaggregator
run: |
docker build \
-t ghcr.io/${{ github.repository_owner }}/psaggregator_frontend:latest \
-t ghcr.io/${{ github.repository_owner }}/psaggregator_frontend:${{ env.VERSION }} \
--build-arg SENTRY_UPLOAD_SOURCEMAPS=true \
--build-arg SENTRY_ORG=${{ vars.SENTRY_ORG }} \
--build-arg SENTRY_PROJECT=${{ vars.SENTRY_PROJECT }} \
--build-arg SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} \
.
- name: Build nginx
working-directory: ./src/nginx
run: docker build -t ghcr.io/${{ github.repository_owner }}/psaggregator_nginx:latest -t ghcr.io/${{ github.repository_owner }}/psaggregator_nginx:${{ env.VERSION }} .
- name: Build dataimport
working-directory: ./src/dataimport
run: docker build -t ghcr.io/${{ github.repository_owner }}/psaggregator_dataimport:latest -t ghcr.io/${{ github.repository_owner }}/psaggregator_dataimport:${{ env.VERSION }} .
- name: Build imageresizer
working-directory: ./src/imageresizer
run: docker build -t ghcr.io/${{ github.repository_owner }}/psaggregator_imageresizer:latest -t ghcr.io/${{ github.repository_owner }}/psaggregator_imageresizer:${{ env.VERSION }} .
- name: Push images
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u zaanposni --password-stdin
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_frontend:${{ env.VERSION }}
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_nginx:${{ env.VERSION }}
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_dataimport:${{ env.VERSION }}
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_imageresizer:${{ env.VERSION }}
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_frontend:latest
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_nginx:latest
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_dataimport:latest
docker push ghcr.io/${{ github.repository_owner }}/psaggregator_imageresizer:latest