chore: release v1.2.2 #2
Workflow file for this run
This file contains hidden or 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 Codeoff Docker image | |
| on: | |
| push: | |
| tags: [ 'v*.*.*' ] | |
| env: | |
| # Use docker.io for Docker Hub if empty | |
| REGISTRY: ghcr.io | |
| # github.repository as <account>/<repo> | |
| IMAGE_NAME: maimorylab/codeoff-server | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Restore build caches | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ${{ runner.temp }}/go-build-cache | |
| ${{ runner.temp }}/npm-cache | |
| key: ${{ runner.os }}-docker-build-${{ hashFiles('go.sum') }} | |
| restore-keys: ${{ runner.os }}-docker-build- | |
| - name: Inject Go build cache | |
| uses: reproducible-containers/buildkit-cache-dance@4b2444fec0c0fb9dbf175a96c094720a692ef810 # v2.1.4 | |
| with: | |
| cache-source: ${{ runner.temp }}/go-build-cache | |
| scratch-dir: ${{ runner.temp }}/buildkit-cache-dance | |
| - name: Inject npm cache | |
| uses: reproducible-containers/buildkit-cache-dance@4b2444fec0c0fb9dbf175a96c094720a692ef810 # v2.1.4 | |
| with: | |
| cache-source: ${{ runner.temp }}/npm-cache | |
| cache-target: /root/.npm | |
| scratch-dir: ${{ runner.temp }}/buildkit-cache-dance-npm | |
| - name: Log into registry ${{ env.REGISTRY }} | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| id: build-and-push | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |