diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml deleted file mode 100644 index cc7571f..0000000 --- a/.github/workflows/deployment.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Deployment - -on: - push: - branches: [main] - merge_group: - pull_request: - branches: [main] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Automatically cancel in-progress actions on the same branch -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} - cancel-in-progress: true - -env: - REGISTRY: docker.io - IMAGE_NAME: trueberryless/mutanuq - NODE_VERSION: 20 - -jobs: - deployment: - if: contains(github.event.head_commit.message, 'deploy') || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Check out the repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Create tag - run: echo "IMAGE_TAG=$(echo $GITHUB_REF_NAME-$GITHUB_SHA)" >> $GITHUB_ENV - - - name: Setup PNPM - uses: pnpm/action-setup@v3 - with: - package_json_file: ./starlight/package.json - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - cache-dependency-path: ./starlight/pnpm-lock.yaml - - - name: Install dependencies - run: pnpm install - shell: bash - working-directory: ./starlight - - - name: Build Mutanuq Website - run: pnpm run build - shell: bash - working-directory: ./starlight - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: | - ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} - ${{ env.IMAGE_NAME }}:latest - labels: ${{ steps.meta.outputs.labels }} - - - name: Update deployment.yaml file - run: | - yq eval '.spec.template.spec.containers[0].image = "${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}"' -i manifest/deployment.yaml - - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: update deployment.json container image (automated) - - - uses: ncipollo/release-action@v1 - with: - tag: ${{ env.IMAGE_TAG }} - makeLatest: true - body: "A docker image has been deployed to [Docker Hub](https://hub.docker.com/r/${{ env.IMAGE_NAME }}/tags)."