Dereposted post should be removed from the feed #1455
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: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Biome | |
uses: biomejs/setup-biome@v2 | |
- name: Run Biome | |
run: biome ci . | |
check-yarn-lock: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'yarn' | |
- name: Check yarn.lock | |
run: yarn install --frozen-lockfile | |
build-test-deploy: | |
name: Build, Test and Deploy | |
environment: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: ActivityPub Docker meta | |
id: activitypub-docker-metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
europe-west4-docker.pkg.dev/ghost-activitypub/main/activitypub | |
tags: | | |
type=edge,branch=main | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha,priority=1100 | |
- name: Migrations Docker meta | |
id: migrations-docker-metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
europe-west4-docker.pkg.dev/ghost-activitypub/main/migrations | |
tags: | | |
type=edge,branch=main | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha,priority=1100 | |
- name: "Build Docker Image for ActivityPub" | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
load: true | |
tags: ${{ steps.activitypub-docker-metadata.outputs.tags }} | |
- name: "Build Docker Image for Migrations" | |
uses: docker/build-push-action@v6 | |
with: | |
context: migrate | |
load: true | |
tags: ${{ steps.migrations-docker-metadata.outputs.tags }} | |
- name: "Run Tests" | |
run: yarn test | |
- name: "Login to GAR" | |
if: github.ref == 'refs/heads/main' | |
uses: docker/login-action@v3 | |
with: | |
registry: europe-west4-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.SERVICE_ACCOUNT_KEY }} | |
- name: "Push ActivityPub Docker Image" | |
if: github.ref == 'refs/heads/main' | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.activitypub-docker-metadata.outputs.tags }} | |
- name: "Push Migrations Docker Image" | |
if: github.ref == 'refs/heads/main' | |
uses: docker/build-push-action@v6 | |
with: | |
context: migrate | |
push: true | |
tags: ${{ steps.migrations-docker-metadata.outputs.tags }} | |
- name: "Auth with Google Cloud" | |
if: github.ref == 'refs/heads/main' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }} | |
- name: "Deploy Migrations to Cloud Run" | |
if: github.ref == 'refs/heads/main' | |
uses: 'google-github-actions/deploy-cloudrun@v2' | |
with: | |
image: europe-west4-docker.pkg.dev/ghost-activitypub/main/migrations:${{ steps.migrations-docker-metadata.outputs.version }} | |
region: europe-west4 | |
job: migrations | |
flags: '--wait --execute-now --set-cloudsql-instances=ghost-activitypub:europe-west4:activitypub-db' | |
- name: "Deploy ActivityPub to Cloud Run" | |
if: github.ref == 'refs/heads/main' | |
uses: 'google-github-actions/deploy-cloudrun@v2' | |
with: | |
image: europe-west4-docker.pkg.dev/ghost-activitypub/main/activitypub:${{ steps.activitypub-docker-metadata.outputs.version }} | |
region: europe-west4 | |
service: activitypub |