Merge pull request #53 from litencatt/add-icon #31
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
tagpr: | |
runs-on: ubuntu-latest | |
outputs: | |
tagpr-tag: ${{ steps.run-tagpr.outputs.tag }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: run-tagpr | |
name: Run tagpr | |
uses: Songmu/tagpr@v1 | |
docker-image: | |
needs: tagpr | |
if: needs.tagpr.outputs.tagpr-tag != '' | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get latest version | |
id: latest_version | |
run: | | |
echo -n 'version=' > $GITHUB_OUTPUT | |
gh release list --limit 1 | cut -f 1 >> $GITHUB_OUTPUT | |
cat $GITHUB_OUTPUT | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub 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@v5 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
# https://github.com/docker/build-push-action/issues/820 | |
provenance: false | |
tags: | | |
ghcr.io/${{ github.actor }}/notion-bot:latest | |
ghcr.io/${{ github.actor }}/notion-bot:${{ steps.latest_version.outputs.version }} | |
labels: | | |
org.opencontainers.image.name=notion-bot | |
org.opencontainers.image.revision=${{ github.sha }} | |
org.opencontainers.image.version=${{ steps.latest_version.outputs.version }} | |
org.opencontainers.image.source=https://github.com/litencatt/notion-bot |