From c0d60aca33944a0b32e843507dc1d90809a459f7 Mon Sep 17 00:00:00 2001 From: Tomu1572 <83832206+Tomu1572@users.noreply.github.com> Date: Fri, 12 Apr 2024 01:30:07 +0700 Subject: [PATCH 1/2] Update and rename publish.yml to docker-publish.yml --- .github/workflows/docker-publish.yml | 49 ++++++++++++++++++++++++ .github/workflows/publish.yml | 56 ---------------------------- 2 files changed, 49 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/docker-publish.yml delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 00000000..b7d7ffad --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,49 @@ +name: Publish Docker image + +# on: +# release: +# types: [published] + +on: + release: + types: [created] + +jobs: + push_to_registries: + name: Push Docker image to multiple registries + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: | + my-docker-hub-namespace/my-docker-hub-repository + ghcr.io/${{ github.repository }} + + - name: Build and push Docker images + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 536de36e..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: 'publish' - -# This will trigger the action on each push to the `release` branch. -on: - push: - branches: - - release - -jobs: - publish-tauri: - permissions: - contents: write - strategy: - fail-fast: false - matrix: - platform: [macos-latest, ubuntu-20.04, windows-latest] - - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v4 - - - name: setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: install Rust stable - uses: dtolnay/rust-toolchain@stable - - - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-20.04' - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf - - - name: install frontend dependencies - run: npm install # change this to npm or pnpm depending on which one you use - - - uses: tauri-apps/tauri-action@v0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version - releaseName: 'Amica v__VERSION__' - releaseBody: | - # Amica __VERSION__ - ## Download Notes - * `.dmg` is for **macOS** - * `.app.tar.gz` is for **macOS** - * `.exe` is for **Windows** - * `.msi` is for **Windows** - * `.AppImage` is for any **Linux 64 bit** - * * **Note**: Be sure to set this to executable to run it (`chmod +x`) - * `.deb` is for Debian (or Ubuntu) distributions - releaseDraft: true - prerelease: false From b4eabffd531d8a2d8d2b8bcc1b34400795d6a2f5 Mon Sep 17 00:00:00 2001 From: Tomu1572 <83832206+Tomu1572@users.noreply.github.com> Date: Fri, 12 Apr 2024 01:32:37 +0700 Subject: [PATCH 2/2] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b7d7ffad..de3547d8 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -37,7 +37,7 @@ jobs: uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: images: | - my-docker-hub-namespace/my-docker-hub-repository + tomu1572/amicahub ghcr.io/${{ github.repository }} - name: Build and push Docker images