Merge pull request #186 from sksat/renovate/swatinem-rust-cache-2.x #367
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: build / container image | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
paths: | |
- 'src/**' | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
- 'rust-toolchain' | |
- 'Dockerfile' | |
- '.github/workflows/build-image.yml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5.6.1 | |
with: | |
images: ghcr.io/${{ github.repository }},sksat/${{ github.event.repository.name }} | |
- name: Set up Buildx | |
uses: docker/setup-buildx-action@v3.8.0 | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3.3.0 | |
if: false | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v3.3.0 | |
if: false | |
with: | |
username: sksat | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and Push | |
uses: docker/build-push-action@v6.10.0 | |
with: | |
context: . | |
push: false | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |