diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..4dfa789 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,43 @@ +name: ci + +on: + schedule: + # build every first of the month + - cron: '0 0 1 * *' + push: + workflow_dispatch: + + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + - + name: Login to Github + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v4 + with: + push: ${{ github.ref == 'refs/heads/main' }} + tags: ghcr.io/andersundsehr/searchforcompose,andersundsehr/searchforcompose