chore: release api patch 0.1.0 #10
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: Publish API Docker image | |
env: | |
PNPM_VERSION: "9.15.0" | |
NODE_VERSION: "22.11.0" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'apps/api/**' | |
jobs: | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
attestations: write | |
id-token: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.SSH_KEY }} | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache-dependency-path: pnpm-lock.yaml | |
- uses: pnpm/[email protected] | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
- name: Install dependencies | |
working-directory: ./apps/api | |
run: | | |
pnpm install | |
- name: Read version from package.json | |
id: get_version | |
working-directory: ./apps/api | |
run: | | |
VERSION=$(jq -r '.version' package.json) | |
echo "Current version: $VERSION" | |
echo "version=$VERSION" >> $GITHUB_ENV | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
with: | |
images: stormix/deadlock-mods-api | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker image | |
id: push | |
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | |
with: | |
context: . | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
file: ./apps/api/Dockerfile | |
push: true | |
tags: | | |
${{ secrets.DOCKER_USERNAME }}/deadlock-mods-api:${{ env.version }} | |
${{ secrets.DOCKER_USERNAME }}/deadlock-mods-api:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Setup ArgoCD CLI | |
run: | | |
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64 | |
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd | |
rm argocd-linux-amd64 | |
- name: Synchronize API | |
run: | | |
argocd app sync deadlock-mod-manager --auth-token "${{ secrets.ARGOCD_TOKEN }}" --server ${{ secrets.ARGOCD_SERVER }} --grpc-web --resource *:Deployment:deadlock-mod-manager-web --replace --force |