Skip to content

use github_env to store date #2

use github_env to store date

use github_env to store date #2

Workflow file for this run

# Workflow for building the container
name: Build the cjpv8 container
on:
# Runs on pushes targeting docker branch
push:
branches: ["actions"]
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Set current date as tag
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Login to GitHub Container registry
uses: docker/login-action@v3
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
registry: ghcr.io
username: $GITHUB_USER
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: ghcr.io/wwu-trap/cjp8:$NOW