Skip to content

swicth workflo to ran on any cases #7

swicth workflo to ran on any cases

swicth workflo to ran on any cases #7

Workflow file for this run

name: 'Build amc2moodle container'
on:
push:
branches:
- '*' #'master'
# tags:
# - 'v*'
jobs:
build:
name: 'Build amc2moodle container'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
with:
latest-branches: 'main,master'
- name: "Build:checkout"
uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}
- name: 'Build:dockerimage'
uses: docker/build-push-action@v6
with:
# relative path to the place where source code with Dockerfile is located
context: ./docker
tags: ghcr.io/${{ github.repository_owner }}/amc2moodle:${{ steps.docker-tag.outputs.tag }},ghcr.io/${{ github.repository_owner }}/amc2moodle:latest
push: true
cache-from: type=gha
cache-to: type=gha
# # build on feature branches, push only on main branch
# push: ${{ github.ref == 'refs/heads/main' }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}