From 3ce9f83ac027ed9491b8110b83a35c8a606dcea6 Mon Sep 17 00:00:00 2001 From: Takahiro Yoshimura Date: Mon, 27 Nov 2023 01:50:44 +0900 Subject: [PATCH] Adding publish workflow --- .github/workflows/publish.yaml | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..7a9d3ba --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,61 @@ +name: publish + +on: + push: + tags: + - v* + +env: + REGISTRY: ghcr.io + +jobs: + deploy: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Setup environment + uses: actions/setup-python@v3 + with: + python-version: 3.11 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64,linux/arm64 + + - name: Login (docker hub) + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login (ghcr) + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: | + alterakey/trueseeing + ghcr.io/${{ github.repository }} + + - name: Check out code + uses: actions/checkout@v3 + + - name: Building and pushing container + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64