Try upping ping timeout for big mathlib transfer #1703
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, publish and deploy | |
# Run on everything. We conditionally skip deployment, but this way the build | |
# is only run once. Testing could be a different workflow, but then the github | |
# runners would need to build it twice, wasting resources. | |
on: [push] | |
env: | |
IMAGE_NAME: velcom-server | |
UID: 1004 | |
jobs: | |
# Build the frontend | |
build-frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2-beta | |
with: | |
node-version: '19' | |
- name: "Build frontend (location independent)" | |
run: "./scripts/build-frontend --env production" | |
- name: "Upload frontend artifacts (location independent)" | |
uses: actions/upload-artifact@v2 | |
with: | |
name: frontend-artifacts | |
path: frontend/dist | |
# Build the shared backend | |
build-backend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: "Build backend" | |
run: "./scripts/build-backend" | |
- name: "Upload backend/backend artifact" | |
uses: actions/upload-artifact@v2 | |
with: | |
name: backend-artifacts | |
path: backend/backend/target/backend.jar | |
- name: "Upload aspectjweaver artifact" | |
uses: actions/upload-artifact@v2 | |
with: | |
name: aspectjweaver-artifact | |
path: backend/backend/target/dependency/aspectjweaver.jar | |
- name: "Upload backend/runner artifacts" | |
uses: actions/upload-artifact@v2 | |
with: | |
name: backend-artifacts | |
path: backend/runner/target/runner.jar | |
- name: Release runner | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: backend/runner/target/runner.jar | |
fail_on_unmatched_files: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Push location independent image to GitHub Packages. | |
push-docker-image: | |
# Ensure build job passes before pushing image. | |
needs: [build-frontend, build-backend] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
# SETUP | |
- uses: actions/checkout@v2 | |
- name: "Download frontend artifacts" | |
uses: actions/download-artifact@v2 | |
with: | |
name: frontend-artifacts | |
path: dist | |
- name: "Download backend artifact" | |
uses: actions/download-artifact@v2 | |
with: | |
name: backend-artifacts | |
- name: "Download aspectjweaver artifact" | |
uses: actions/download-artifact@v2 | |
with: | |
name: aspectjweaver-artifact | |
# BUILDING | |
- name: "Build image" | |
run: "./scripts/docker/build-docker --uid $UID --metrics CI" | |
- name: "Log into registry" | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin | |
- name: Push image | |
run: | | |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME | |
# MUST change all uppercase to lowercase for Docker | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
# Offer the image as latest | |
docker tag $IMAGE_NAME $IMAGE_ID:latest | |
docker push $IMAGE_ID:latest | |
# Deploy main branch to velcom.aaaaaaah.de | |
deploy-aaaaaaah: | |
# Ensure build job passes before pushing image. | |
needs: [push-docker-image] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: "Call deploy script" | |
run: 'curl -H "Authorization: Bearer ${{ secrets.AAAAAAAH_PING_TOKEN }}" ${{ secrets.AAAAAAAH_PING_ENDPOINT }} || echo "We only need the ping, not the response."' | |