deploy-prod #48
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: deploy-prod | |
on: | |
workflow_dispatch: | |
env: | |
SKAFFOLD_DEFAULT_REPO: ghcr.io/con2 | |
jobs: | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Check if skaffold and kubectl found from cache | |
id: cache-bin | |
uses: actions/cache@v4 | |
with: | |
path: bin | |
key: ${{ runner.os }}-bin | |
- name: Download skaffold and kubectl | |
if: steps.cache-bin.outputs.cache-hit != 'true' | |
run: | | |
mkdir bin | |
curl -Lo bin/skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 | |
curl -Lo bin/kubectl https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl | |
chmod +x bin/skaffold bin/kubectl | |
- name: Add skaffold and kubectl to PATH | |
run: echo "$PWD/bin" >> "$GITHUB_PATH" | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GHCR_USERNAME }} | |
password: ${{ secrets.GHCR_PASSWORD }} | |
- uses: docker/setup-buildx-action@v3 | |
- run: | | |
python3 -m pip install setuptools emskaffolden | |
emskaffolden -E production -- run -n konsti-production | |
sentry-release: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-22.04 | |
env: | |
CI: true | |
HUSKY: 0 | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Node.js 20.16.0 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.16.0 | |
cache: "yarn" | |
- name: Yarn install | |
run: | | |
yarn --immutable | |
- name: Build prod frontend | |
run: | | |
yarn build-front:prod | |
- name: Create prod frontend Sentry release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: konsti | |
SENTRY_PROJECT: konsti-frontend-prod | |
with: | |
sourcemaps: "./client/build" | |
ignore_missing: true | |
ignore_empty: true | |
- name: Create prod backend Sentry release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: konsti | |
SENTRY_PROJECT: konsti-backend-prod | |
with: | |
ignore_missing: true | |
ignore_empty: true |