Skip to content

Commit

Permalink
Create publish-docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
manu1987 authored Dec 6, 2024
1 parent 48ab534 commit 3f18cab
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Docker image
# To maastrichtu-library GitHub Container Registry
# https://github.com/orgs/maastrichtu-library/packages
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'Dockerfile'
- '.github/workflows/publish-docker.yml'
schedule:
- cron: '0 4 * * 1'
# Monday at 4:00 GMT+1

env:
IMAGE_PULLED: redis:latest
IMAGE_PUSHED: ghcr.io/maastrichtu-library/redis:latest

jobs:
publish-latest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Log into GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Pull image from DockerHub
run: docker pull $IMAGE_PULLED

- name: Push image to GitHub Container Registry
run: |
docker tag $IMAGE_PULLED $IMAGE_PUSHED
docker push $IMAGE_PUSHED
# - name: Build image
# run: docker build . --file Dockerfile --tag $IMAGE_PUSHED

0 comments on commit 3f18cab

Please sign in to comment.