|
| 1 | +name: release test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + paths: |
| 9 | + - .github/workflows/release-test.yml |
| 10 | + - .goreleaser.yml |
| 11 | + |
| 12 | +jobs: |
| 13 | + dockerimage: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + env: |
| 16 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 17 | + steps: |
| 18 | + - name: Check out source code |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + fetch-depth: 0 |
| 22 | + |
| 23 | + - name: Get latest version |
| 24 | + id: latest_version |
| 25 | + run: | |
| 26 | + echo -n 'version=' > $GITHUB_OUTPUT |
| 27 | + gh release list --limit 1 | cut -f 1 >> $GITHUB_OUTPUT |
| 28 | + cat $GITHUB_OUTPUT |
| 29 | +
|
| 30 | + - name: Set up QEMU |
| 31 | + uses: docker/setup-qemu-action@v3 |
| 32 | + |
| 33 | + - name: Set up Docker Buildx |
| 34 | + uses: docker/setup-buildx-action@v3 |
| 35 | + |
| 36 | + - name: Build (slim) |
| 37 | + uses: docker/build-push-action@v6 |
| 38 | + with: |
| 39 | + context: . |
| 40 | + file: Dockerfile.slim |
| 41 | + platforms: linux/amd64,linux/arm64 |
| 42 | + push: false |
| 43 | + tags: | |
| 44 | + ghcr.io/k1low/runn:${{ steps.latest_version.outputs.version }}-slim |
| 45 | + ghcr.io/k1low/runn:latest-slim |
| 46 | + labels: | |
| 47 | + org.opencontainers.image.name=runn |
| 48 | + org.opencontainers.image.revision=${{ github.sha }} |
| 49 | + org.opencontainers.image.version=${{ steps.latest_version.outputs.version }} |
| 50 | + org.opencontainers.image.source=https://github.com/k1LoW/runn |
| 51 | +
|
| 52 | + - name: Build |
| 53 | + uses: docker/build-push-action@v6 |
| 54 | + with: |
| 55 | + context: . |
| 56 | + file: Dockerfile |
| 57 | + platforms: linux/amd64,linux/arm64 |
| 58 | + push: false |
| 59 | + tags: | |
| 60 | + ghcr.io/k1low/runn:${{ steps.latest_version.outputs.version }} |
| 61 | + ghcr.io/k1low/runn:latest |
| 62 | + labels: | |
| 63 | + org.opencontainers.image.name=runn |
| 64 | + org.opencontainers.image.revision=${{ github.sha }} |
| 65 | + org.opencontainers.image.version=${{ steps.latest_version.outputs.version }} |
| 66 | + org.opencontainers.image.source=https://github.com/k1LoW/runn |
0 commit comments