fix #15
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: pipeline | |
on: [push] | |
jobs: | |
release: | |
if: contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
push-to-dockerhub: | |
if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
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 Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Create Buildx builder | |
run: | | |
docker buildx create --use --name mybuilder | |
docker buildx inspect mybuilder --bootstrap | |
- name: Build and Push (latest) | |
if: github.ref == 'refs/heads/master' | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: psyb0t/safe-transmission:latest | |
- name: Get Release Version | |
if: contains(github.ref, 'refs/tags/') | |
run: | | |
RELEASE_VERSION=${GITHUB_REF#refs/*/} | |
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | |
- name: Build and Push New Release | |
if: contains(github.ref, 'refs/tags/') | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: psyb0t/safe-transmission:${{env.RELEASE_VERSION}} | |
- name: Docker Hub Description | |
uses: peter-evans/dockerhub-description@v4 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
repository: psyb0t/safe-transmission |