Skip to content

Containers

Containers #10

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:
paths:
- .devcontainer/rust-zen/Dockerfile
branches:
- main
workflow_dispatch:
jobs:
push-rust-container:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Metadata
id: meta
uses: docker/metadata-action@v5
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@v5
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 }}