Skip to content

Commit

Permalink
Migrated website deployment to GitHub Actions. (#6524)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Sep 11, 2023
1 parent 4c20dbb commit fc9438b
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 118 deletions.
30 changes: 0 additions & 30 deletions .devops/azure-pipelines.sonar-hotchocolate.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .devops/deploy-website-cluster.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .devops/deploy-website.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/publish-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Publish Website

# When to trigger the workflow
on:
push:
branches:
- main
paths:
- .github/workflows/publish-website.yml
- .docker/website/**
- website/**

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Docker Login
uses: docker/login-action@v2
with:
registry: ${{ secrets.CONTAINER_REG_URL }}
username: ${{ secrets.CONTAINER_REG_USERNAME }}
password: ${{ secrets.CONTAINER_REG_PASSWORD }}

- run: echo ${{ secrets.CONTAINER_REG_URL }}

- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '18.x'
cache: 'yarn'
cache-dependency-path: 'website/yarn.lock'

- name: Cache Yarn Packages
uses: actions/cache@v3
with:
path: |
website/.yarn/cache
website/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('website/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Packages
run: yarn --immutable --network-timeout 100000
working-directory: website

- name: Build Website
run: yarn build --prefix-paths
working-directory: website

- name: Build WebSite Container
uses: docker/build-push-action@v2
with:
context: .
file: .docker/website/dockerfile
push: true
tags: ${{ secrets.CONTAINER_REG_DOMAIN }}/ccc-website-${{ github.ref_name }}:${{ github.run_id }}

- name: Deploy to Azure WebApp
uses: azure/webapps-deploy@v2
with:
app-name: ccc-p-us1-website
slot-name: 'production'
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
images: ${{ secrets.CONTAINER_REG_DOMAIN }}/ccc-website-${{ github.ref_name }}:${{ github.run_id }}

0 comments on commit fc9438b

Please sign in to comment.