diff --git a/.actrc b/.actrc new file mode 100644 index 0000000..51dd9cd --- /dev/null +++ b/.actrc @@ -0,0 +1,2 @@ +-P ubuntu-latest=catthehacker/ubuntu:act-latest +--secret-file .secrets \ No newline at end of file diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..286758a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.secrets +.act \ No newline at end of file diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml new file mode 100644 index 0000000..60ea258 --- /dev/null +++ b/.github/workflows/deploy-docker-image.yml @@ -0,0 +1,51 @@ +name: Deploy docker image + +on: + push: + branches: + - "master" + tags: + - "*" + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + + steps: + - uses: actions/checkout@v2 + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + ${{ secrets.DOCKERHUB_REPOSITORY }} + ghcr.io/${{ github.repository }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b4ddc88 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.secrets \ No newline at end of file