Update docker-publish-ghcr.yml

this sucks man
This commit is contained in:
Matthew Connelly 2022-08-17 14:26:48 +01:00 committed by GitHub
parent 2fdc270ed8
commit aa7024ab9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 17 deletions

View File

@ -5,15 +5,11 @@ on:
# - cron: '45 4 * * *' # - cron: '45 4 * * *'
push: push:
branches: [ "main" ] branches: [ "main" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
IMAGE_NAME: jupyter-simple IMAGE_NAME: jupyter-simple
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -25,25 +21,15 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
- name: Log into registry ${{ env.REGISTRY }} - name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image - name: Build and push Docker image
id: build-and-push id: build-and-push
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a uses: docker/build-push-action@v3.1.1
with: with:
context: . push: true
push: ${{ github.event_name != 'pull_request' }} tags: ${{ github.actor }}/${{ env.IMAGE_NAME }}:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}