broken website changes #296
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: CI | |
on: | |
push: | |
branches: | |
- prod | |
- main | |
workflow_dispatch: | |
env: | |
SQLX_OFFLINE: true | |
jobs: | |
check: | |
uses: ./.github/workflows/check.yml | |
build: | |
runs-on: ubuntu-latest | |
needs: [check] | |
steps: | |
- name: Check out code into the proper directory | |
uses: actions/checkout@v4 | |
- name: Install cargo | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-unknown-linux-musl | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2 | |
- name: Install musl-dev | |
run: sudo apt install musl-dev musl-tools | |
- name: Build executables | |
run: cargo b --release --target x86_64-unknown-linux-musl | |
- name: Upload executables | |
uses: actions/upload-artifact@v3 | |
with: | |
name: executables | |
path: | | |
target/x86_64-unknown-linux-musl/release/xpd-web | |
target/x86_64-unknown-linux-musl/release/xpd-gateway | |
publish: | |
runs-on: ubuntu-latest | |
needs: [build] | |
strategy: | |
fail-fast: true | |
matrix: | |
module: [xpd-web, xpd-gateway] | |
steps: | |
- name: Check out code into the proper directory | |
uses: actions/checkout@v4 | |
- name: Download executables | |
uses: actions/download-artifact@v3 | |
with: | |
name: executables | |
path: executables | |
- name: chmod +x | |
run: chmod +x ./executables/* | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build production container | |
if: ${{ github.ref_name == 'prod' }} | |
uses: docker/build-push-action@v5 | |
with: | |
file: ${{ matrix.module }}/Dockerfile | |
context: . | |
push: true | |
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.module }}:latest | |
platforms: linux/amd64 | |
- name: Build unstable container | |
if: ${{ github.ref_name == 'main' }} | |
uses: docker/build-push-action@v5 | |
with: | |
file: ${{ matrix.module }}/Dockerfile | |
context: . | |
push: true | |
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.module }}:unstable | |
platforms: linux/amd64 | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [publish] | |
steps: | |
- name: Notify bot of updates | |
run: "curl --max-time 30 -H 'Authorization: Bearer ${{ secrets.RESTART_TOKEN }}' https://hooks.valk.sh/xpd-${{ github.ref_name }}" |