Merge pull request #132 from depot/concurrency #466
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 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: depot-ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4.0.0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '16' | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm lint | |
| - run: pnpm type-check | |
| - run: pnpm build | |
| package: | |
| name: Package | |
| runs-on: depot-ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: depot/setup-action@v1 | |
| - name: Compute version | |
| id: version | |
| run: | | |
| if [[ "$GITHUB_REF" == refs/tags/v* ]]; then | |
| echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=${GITHUB_REF}" >> $GITHUB_OUTPUT | |
| fi | |
| - uses: docker/metadata-action@v5 | |
| id: meta | |
| with: | |
| images: ghcr.io/depot/cloud-agent | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: depot/build-push-action@v1 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: CLOUD_AGENT_VERSION=${{ steps.version.outputs.version }} |