Update action to push to docker hub #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master-censys | |
# Cancel in-progress runs in current workflow. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: "Setup docker qemu" | |
uses: docker/setup-qemu-action@v3 | |
- name: "Setup docker buildx" | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push image | |
run: | | |
VERSION=$(date -u +%Y.%-m%d.%-s) | |
docker buildx build --platform linux/amd64 -t censys/oathkeeper:$VERSION --progress=plain --tag censys/oathkeeper:$VERSION --push -f .docker/Dockerfile-build . |