v2024.01.01: year++ #257
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 and deploy (production) | |
on: | |
release: | |
types: [published] | |
env: | |
RELEASE_NAME: website | |
CHART_VALUES_FILE: .helm/values.prod.yml | |
DEPLOY_NAMESPACE: sledilnik-prod | |
DEPLOY_ENV: production | |
DEPLOY_URL: https://covid-19.sledilnik.org | |
IMAGE_TAG: ${{ github.event.release.tag_name }} | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Debug | |
uses: hmarr/[email protected] | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- uses: actions/[email protected] | |
with: | |
node-version: '18' | |
- run: yarn | |
- run: yarn lint | |
# - run: yarn test | |
# - run: yarn dotnet-restore | |
# - run: yarn test-fsharp | |
build: | |
runs-on: ubuntu-20.04 | |
needs: test | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to ghcr.io | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Build and push docker container image | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
context: . | |
file: ./Dockerfile | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/website:${{ env.IMAGE_TAG}} | |
build-args: | | |
BUILD_MODE=production | |
deploy: | |
runs-on: ubuntu-20.04 | |
needs: build | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Deploy | |
uses: sledilnik/[email protected] | |
with: | |
chartName: sledilnik/website | |
chartVersion: '1.0.0' | |
kubeconfig: '${{ secrets.KUBECONFIG }}' | |
- name: Slack notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
icon_url: 'https;//github.com/sledilnik.png?size=32' | |
author_name: 'Deploy bot' | |
status: custom | |
fields: repo,workflow,job | |
custom_payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Production deploy finished with status: ${{ job.status }}" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "URL: ${{ env.DEPLOY_URL }}" | |
} | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |