chore(deps): update renovatebot/github-action action to v46.1.5 #138
This file contains hidden or 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: Docker Image | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build_and_test: | |
| name: Build, Test and Publish Docker Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v6 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Set build variables | |
| id: vars | |
| run: | | |
| echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | |
| echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: logchange/valhalla | |
| tags: | | |
| type=edge,branch=main | |
| type=ref,event=tag | |
| labels: | | |
| org.opencontainers.image.version=${{ steps.vars.outputs.version }} | |
| org.opencontainers.image.ref.name=${{ steps.vars.outputs.version }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.created=${{ steps.vars.outputs.build_date }} | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| load: true # load image into docker | |
| push: false # don't push image to docker before tests | |
| tags: logchange/valhalla:test | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Print image labels | |
| run: | | |
| docker inspect logchange/valhalla:test \ | |
| --format '{{json .Config.Labels}}' | jq . | |
| - name: Test Docker image | |
| uses: plexsystems/container-structure-test-action@v0.3.0 | |
| with: | |
| image: logchange/valhalla:test | |
| config: docker-test.yml | |
| - name: Push Docker Image | |
| uses: docker/build-push-action@v7 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Update Docker Hub Description | |
| uses: peter-evans/dockerhub-description@v5 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| repository: logchange/valhalla |