chore(deps): update alpine docker tag to v3.21 in dockerfile (#23) #9
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
name: "Release" | |
on: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: {} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
publish: | |
name: "Publish" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Compute PocketBase version | |
run: echo "POCKETBASE_VERSION=$(cat ./Dockerfile | sed -nr 's/ARG POCKETBASE_VERSION=(.*)/\1/p')" >> $GITHUB_ENV | |
- name: Compute Litestream version | |
run: echo "LITESTREAM_VERSION=$(cat ./Dockerfile | sed -nr 's/ARG LITESTREAM_VERSION=(.*)/\1/p')" >> $GITHUB_ENV | |
- name: Set the commit hash | |
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Set the build timestamp | |
run: echo "BUILD_TIMESTAMP=$(date +"%Y%m%d%H%M%S")" >> $GITHUB_ENV | |
- name: Compute release tag | |
run: echo "RELEASE_TAG=v${POCKETBASE_VERSION}-ls${LITESTREAM_VERSION}" >> $GITHUB_ENV | |
- name: Login to Packages Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: "./Dockerfile" | |
builder: ${{ steps.buildx.outputs.name }} | |
platforms: linux/arm64,linux/amd64 | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}:latest | |
ghcr.io/${{ github.repository }}:${{ env.RELEASE_TAG }} | |
ghcr.io/${{ github.repository }}:${{ env.RELEASE_TAG }}-${{ env.COMMIT_HASH }} | |
ghcr.io/${{ github.repository }}:${{ env.RELEASE_TAG }}-${{ env.COMMIT_HASH }}-${{ env.BUILD_TIMESTAMP }} | |
- name: Generate NOTES.md | |
env: | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
GIT_REF: ${{ github.ref_name }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "## Versions" >> NOTES.md | |
echo "Pocketbase: [v$POCKETBASE_VERSION](https://github.com/pocketbase/pocketbase/releases/tag/v$POCKETBASE_VERSION)" >> NOTES.md | |
echo "Litestream: [v$LITESTREAM_VERSION](https://github.com/benbjohnson/litestream/releases/tag/v$LITESTREAM_VERSION)" >> NOTES.md | |
echo "" >> NOTES.md | |
gh api repos/$GITHUB_REPOSITORY/releases/generate-notes -f tag_name=$RELEASE_TAG -f target_commitish=$GIT_REF -q .body >> NOTES.md | |
cat NOTES.md >> $GITHUB_STEP_SUMMARY | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body_path: "NOTES.md" | |
name: ${{ env.RELEASE_TAG }} | |
tag_name: ${{ env.RELEASE_TAG }} | |
make_latest: 'true' |