New features new bugs new bug fixes #488
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: Build production image | |
on: | |
#workflow_run: | |
# workflows: ["Test and build staging-image"] | |
# branches: [master] | |
# types: [completed] | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: 'Build and publish production image' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: lomake | |
tags: production ${{ github.sha }} | |
containerfiles: | | |
./Dockerfile | |
build-args: | | |
BASE_PATH=/tilannekuva/ | |
SENTRY_ENVIRONMENT=production | |
extra-args: | | |
--ulimit nofile=4096:4096 | |
- name: Push to quay.io | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: quay.io/toska | |
username: toska+github | |
password: ${{ secrets.QUAY_IO_TOKEN }} | |
report_success: | |
name: 'Report release success to Tilku-channel' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
if: success() | |
steps: | |
- name: 'Send notification to Slack' | |
uses: UniversityOfHelsinkiCS/[email protected] | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
message-type: deployment | |
softa-url: https://opetushallinto.cs.helsinki.fi/tilannekuva | |
deployment-target: production | |
report_failure: | |
name: 'Report release failure to Tilku-channel' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
if: failure() | |
steps: | |
- name: 'Send notification to Slack' | |
uses: UniversityOfHelsinkiCS/[email protected] | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
message-type: deployment-failure | |
sentry-release: | |
name: 'Create Sentry release' | |
runs-on: ubuntu-latest | |
needs: report_success | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract release version | |
id: extract_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
- name: Pull image and create a container | |
run: docker create --name lomake_sentry quay.io/toska/lomake:production | |
- name: Copy assets from the container | |
run: docker cp lomake_sentry:/opt/app-root/src/build ./build | |
- name: Create Sentry release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_URL: https://toska.cs.helsinki.fi/ | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_TOKEN }} | |
SENTRY_ORG: toska | |
SENTRY_PROJECT: lomake | |
with: | |
environment: production | |
set_commits: 'skip' | |
sourcemaps: './build' | |
url_prefix: '~/tilannekuva' | |
version: ${{ steps.extract_version.outputs.VERSION }} |