Skip to content

Update actions/checkout action to v5 - autoclosed #36

Update actions/checkout action to v5 - autoclosed

Update actions/checkout action to v5 - autoclosed #36

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Build
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ deployment, main ]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@v5
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract branch name
shell: bash
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
id: extract_branch
-
name: Generate tag
id: generate_tag
shell: bash
run: echo "::set-output name=tag::$(echo ${{ github.sha }} | cut -c1-7)-$(date +%s)"
- name: Build
uses: docker/build-push-action@v2
with:
context: ./
platforms: linux/amd64
push: ${{ startsWith( steps.extract_branch.outputs.branch , 'deployment' ) }}
tags: "ghcr.io/ueckoken/docker-postfix:${{ steps.generate_tag.outputs.tag }}"