-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workflows): build and publish docker image
- Loading branch information
Showing
1 changed file
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Build & Publish | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: latest | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'pnpm' | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
pnpm install --frozen-lockfile | ||
- name: Run build | ||
run: | | ||
pnpm build | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
timeout-minutes: 5 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Docker build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: ghcr.io/${{ github.repository_owner }}/interledger-pay:${{ github.ref_name }},ghcr.io/${{ github.repository_owner }}/interledger-pay:latest | ||
|
||
generate-release: | ||
runs-on: ubuntu-latest | ||
needs: publish | ||
timeout-minutes: 5 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Update CHANGELOG | ||
id: changelog | ||
uses: requarks/changelog-action@v1 | ||
with: | ||
token: ${{ github.token }} | ||
tag: ${{ github.ref_name }} | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1.12.0 | ||
with: | ||
allowUpdates: true | ||
draft: false | ||
makeLatest: true | ||
name: ${{ github.ref_name }} | ||
body: ${{ steps.changelog.outputs.changes }} | ||
tag: ${{ github.ref_name }} | ||
token: ${{ github.token }} | ||
- name: Commit CHANGELOG.md | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
branch: main | ||
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]' | ||
file_pattern: CHANGELOG.md |