Skip to content

Merge pull request #25 from i13302/feature/upd-key #7

Merge pull request #25 from i13302/feature/upd-key

Merge pull request #25 from i13302/feature/upd-key #7

Workflow file for this run

name: Push Image
on:
push:
branches:
- "master"
# - "dev/action/push-image"
jobs:
push_image:
runs-on: i13302-actions
env:
image-name: latexactionstemplate
steps:
- name: checkout
uses: actions/checkout@v4
- name: Create TAGS
run: |
SHA=${{ github.sha }}
TAG=$(TZ=UTC-9 date '+%Y%m')-${SHA:0:7}
echo "TAGS=$TAG" >> $GITHUB_ENV
echo TAG $TAG
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ github.ref }}-${{ github.sha }}
${{ github.ref }}
refs/head/master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .github/docker/
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ env.image-name }}:latest
ghcr.io/${{ github.repository_owner }}/${{ env.image-name }}:${{ env.TAGS }}
cache-from: type=local,src=/tmp/${{ env.image-name }}/.buildx-cache
cache-to: type=local,dest=/tmp/${{ env.image-name }}/.buildx-cache