Docker Publish #444
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
folderPath: | |
description: "Path to the folder" | |
required: true | |
default: 'webdav-apache-php7.3' | |
dockerFile: | |
description: "Optional relative (from folder) path to Dockerfile. Default is $folder/Dockerfile" | |
required: false | |
default: 'Dockerfile' | |
suffix: | |
description: "Option suffix to image name (e.g. `-documentation`)" | |
required: false | |
tagName: | |
description: "Tag name" | |
required: true | |
default: 'latest' | |
jobs: | |
push_to_registry: | |
runs-on: ubuntu-22.04 | |
name: Push Docker image ${{ github.event.inputs.folderPath }}${{ github.event.inputs.suffix }}:${{ github.event.inputs.tagName }} to GitHub Packages | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Check actor permission | |
uses: skjnldsv/check-actor-permission@v2 | |
with: | |
require: admin | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Log in to GitHub Docker Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: docker.pkg.github.com | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build container image | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
context: ${{ github.event.inputs.folderPath }} | |
file: '${{ github.event.inputs.folderPath }}/${{ github.event.inputs.dockerFile }}' | |
tags: | | |
ghcr.io/nextcloud/continuous-integration-${{ github.event.inputs.folderPath }}${{ github.event.inputs.suffix }}:${{ github.event.inputs.tagName }} |