From 7243ca28c0a6297ca342305d9fb69488278db386 Mon Sep 17 00:00:00 2001 From: aceberg <1502200+aceberg@users.noreply.github.com> Date: Mon, 22 Aug 2022 17:26:33 +0700 Subject: [PATCH] Actions workflow --- .github/workflows/docker-publish.yml | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..1fbe2dc --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,44 @@ +name: Docker + +on: + push: + branches: [ "main" ] + paths-ignore: + - '**.md' + pull_request: + branches: [ "main" ] + paths-ignore: + - '**.md' + +env: + IMAGE_NAME: watchyourlan + TAGS: v0.5 + + +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 }} + addLatest: true + 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 }} + addLatest: true + registry: docker.io + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file