Skip to content

Trigger on this branch. #1

Trigger on this branch.

Trigger on this branch. #1

Workflow file for this run

name: Containers
permissions: write-all
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-rust-ci
BAZEL_VERSION: "6.4.0"
RUSTC_VERSION: "1.75.0"
on:
push:
# TODO: Uncomment the following line to restrict the action to the main branch
# paths:
# - .devcontainer/rust-zen/Dockerfile
# branches:
# - main # Uncomment!
workflow_dispatch:
jobs:
push-rust-container:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to GCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Echo
run: |
echo "USER: ${{ github.actor }}"
echo "REPOSITORY: ${{ github.repository }}"
echo "TAGS: ${{ steps.meta.outputs.tags }}"
echo "LABELS: ${{ steps.meta.outputs.labels }}"
- name: Image - Rust
uses: docker/build-push-action@v3
with:
file: ./.devcontainer/rust-zen/Dockerfile
push: true
build-args: |
BAZEL_VERSION=${{ env.BAZEL_VERSION }}
RUSTC_VERSION=${{ env.RUSTC_VERSION }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:rust${{ env.RUSTC_VERSION }}
labels: ${{ steps.meta.outputs.labels }}