Add admin task for merging PGCs (#74) #11
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: CI | |
| on: | |
| push: | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Generate code | |
| run: make gen | |
| - name: Run checks | |
| run: make check | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Docker runtime | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Generate code | |
| run: make gen | |
| - name: Build image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| load: true | |
| push: false | |
| tags: local/app:latest | |
| - name: Save image | |
| run: docker save local/app:latest -o image.tar | |
| - name: Upload image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-image | |
| path: image.tar | |
| retention-days: 1 | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [tests, build] | |
| if: github.ref_name == github.event.repository.default_branch | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Download image | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docker-image | |
| - name: Set up Docker runtime | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Load image | |
| run: docker load -i image.tar | |
| - name: Set image name | |
| run: echo "IMAGE_NAME=ghcr.io/hyperleda/hyperleda-webapp" >> "$GITHUB_ENV" | |
| - name: Set short SHA | |
| run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV" | |
| - name: Push image | |
| run: | | |
| docker tag local/app:latest ${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }} | |
| docker tag local/app:latest ${{ env.IMAGE_NAME }}:latest | |
| docker push ${{ env.IMAGE_NAME }}:${{ env.SHORT_SHA }} | |
| docker push ${{ env.IMAGE_NAME }}:latest |