From 7bb804f1da60a51842f4d4ea14d68d79f37066a1 Mon Sep 17 00:00:00 2001 From: aceberg <1502200+aceberg@users.noreply.github.com> Date: Mon, 5 Sep 2022 19:49:42 +0700 Subject: [PATCH] Action test --- .github/workflows/dev-arm-docker.yml | 63 ++++++++++++++++++++++++++++ .version | 1 + 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/dev-arm-docker.yml create mode 100644 .version diff --git a/.github/workflows/dev-arm-docker.yml b/.github/workflows/dev-arm-docker.yml new file mode 100644 index 0000000..07d81de --- /dev/null +++ b/.github/workflows/dev-arm-docker.yml @@ -0,0 +1,63 @@ +name: Docker-dev + +on: + push: + branches: [ "main" ] + paths: + - 'Dockerfile' + - '.version' + - 'src/**' + pull_request: + branches: [ "main" ] + paths: + - 'Dockerfile' + - '.version' + - 'src/**' + +env: + IMAGE_NAME: watchyourlan + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Get version tag from env file + uses: c-py/action-dotenv-to-setenv@v2 + with: + env-file: .version + + - 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 + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + 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 diff --git a/.version b/.version new file mode 100644 index 0000000..29c7dec --- /dev/null +++ b/.version @@ -0,0 +1 @@ +VERSION=0.7.4 \ No newline at end of file