From 5c98d46129d35c6021482109f441427ab3e6f25d Mon Sep 17 00:00:00 2001 From: aceberg <1502200+aceberg@users.noreply.github.com> Date: Mon, 5 Sep 2022 20:15:13 +0700 Subject: [PATCH] Action main --- .github/workflows/arm-docker-publish.yml | 68 ------------------- .../{dev-publish.yml => dev-docker-io.yml} | 0 .github/workflows/ghcr-publish.yml | 44 ------------ ...dev-arm-docker.yml => main-docker-all.yml} | 12 ++-- 4 files changed, 5 insertions(+), 119 deletions(-) delete mode 100644 .github/workflows/arm-docker-publish.yml rename .github/workflows/{dev-publish.yml => dev-docker-io.yml} (100%) delete mode 100644 .github/workflows/ghcr-publish.yml rename .github/workflows/{dev-arm-docker.yml => main-docker-all.yml} (92%) diff --git a/.github/workflows/arm-docker-publish.yml b/.github/workflows/arm-docker-publish.yml deleted file mode 100644 index 11905b3..0000000 --- a/.github/workflows/arm-docker-publish.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Docker - -on: - push: - branches: [ "main" ] - paths: - - 'Dockerfile' - - 'src/**' - pull_request: - branches: [ "main" ] - paths: - - 'Dockerfile' - - 'src/**' - -env: - IMAGE_NAME: watchyourlan - TAGS: v0.7.3 - - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - # - name: Login to GHCR - # # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to Docker Hub - # if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Docker meta - id: meta1 # you'll use this in the next step - uses: docker/metadata-action@v4 - with: - # list of Docker images to use as base name for tags - images: ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }} - # Docker tags based on the following events/attributes - tags: | - latest - ${{ env.TAGS }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - # platforms: linux/arm/v6,linux/arm/v7,linux/arm64 - platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 - push: true - tags: ${{ steps.meta1.outputs.tags }} \ No newline at end of file diff --git a/.github/workflows/dev-publish.yml b/.github/workflows/dev-docker-io.yml similarity index 100% rename from .github/workflows/dev-publish.yml rename to .github/workflows/dev-docker-io.yml diff --git a/.github/workflows/ghcr-publish.yml b/.github/workflows/ghcr-publish.yml deleted file mode 100644 index 296ce7b..0000000 --- a/.github/workflows/ghcr-publish.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Publish to ghcr.io - -on: - push: - branches: [ "main" ] - paths: - - 'Dockerfile' - - 'src/**' - pull_request: - branches: [ "main" ] - paths: - - 'Dockerfile' - - 'src/**' - -env: - IMAGE_NAME: watchyourlan - TAGS: latest, v0.7.3 - - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Build and Push Docker Image to ghcr.io - uses: mr-smithers-excellent/docker-build-push@v5 - with: - image: ${{ env.IMAGE_NAME }} - tags: ${{ env.TAGS }} - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # - name: Build and Push Docker Image to docker.io - # uses: mr-smithers-excellent/docker-build-push@v5 - # with: - # image: ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }} - # tags: ${{ env.TAGS }} - # registry: docker.io - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/dev-arm-docker.yml b/.github/workflows/main-docker-all.yml similarity index 92% rename from .github/workflows/dev-arm-docker.yml rename to .github/workflows/main-docker-all.yml index 07d81de..0420f72 100644 --- a/.github/workflows/dev-arm-docker.yml +++ b/.github/workflows/main-docker-all.yml @@ -1,17 +1,15 @@ -name: Docker-dev +name: Docker on: push: branches: [ "main" ] paths: - 'Dockerfile' - - '.version' - 'src/**' pull_request: branches: [ "main" ] paths: - 'Dockerfile' - - '.version' - 'src/**' env: @@ -57,7 +55,7 @@ jobs: platforms: linux/amd64,linux/arm/v7,linux/arm64 push: true tags: | - ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:dev - ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:dev-${{ env.VERSION }} - ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:dev - ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:dev-${{ env.VERSION }} \ No newline at end of file + ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest + ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} + ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest + ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} \ No newline at end of file