-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (42 loc) · 1.32 KB
/
pr-push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
name: Push and comment PR build
on:
workflow_run:
workflows:
- "Build Images for PRs"
types:
- completed
jobs:
push:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.conclusion == 'success'
steps:
- name: Load artifact
uses: actions/download-artifact@v4
with:
name: oci-image
path: /oci-image.tar
- name: Login to Docker hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Load image
run: |
docker load --input /oci-image.tar
docker image ls -a
- name: Docker push image
run: |
docker push hobbyfarm/hf-provisioner-digitalocean:${{ github.event.pull_request.head.sha }}
- name: Comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.DEMETER_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'An image has been built, my little sprouts. Find it here: hobbyfarm/hf-provisioner-digitalocean:${{ github.event.pull_request.head.sha }}'
})