Skip to content

Commit e8270d2

Browse files
committed
Add ghcr workflows
1 parent baa5e12 commit e8270d2

File tree

1 file changed

+21
-56
lines changed

1 file changed

+21
-56
lines changed

.github/workflows/deploy.yml

+21-56
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,28 @@
1-
name: Push to GHCR
1+
name: Deploy Images to GHCR
22

33
on:
44
push:
55
branches:
66
- main
7-
8-
env:
9-
IMAGE_NAME: torrenthunt
10-
IMAGE_TAGS: latest ${{ github.sha }}
11-
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
12-
REGISTRY_USER: ${{ github.actor }}
13-
REGISTRY_PASSWORD: ${{ github.token }}
7+
workflow_dispatch:
148

159
jobs:
16-
push-ghcr:
17-
name: Build and push image
18-
runs-on: ubuntu-20.04
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
install_latest: [ true, false ]
23-
24-
steps:
25-
# Checkout push-to-registry action github repository
26-
- name: Checkout Push to Registry action
27-
uses: actions/checkout@v2
28-
29-
- name: Install latest podman
30-
if: matrix.install_latest
31-
run: |
32-
bash .github/install_latest_podman.sh
33-
34-
# Build image using Buildah action
35-
- name: Build Image
36-
id: build_image
37-
uses: redhat-actions/buildah-build@v2
38-
with:
39-
image: ${{ env.IMAGE_NAME }}
40-
tags: ${{ env.IMAGE_TAGS }}
41-
base-image: busybox:latest
42-
entrypoint: |
43-
bash
44-
-c
45-
echo 'hello world'
46-
oci: true
47-
48-
# Push the image to GHCR (Image Registry)
49-
- name: Push To GHCR
50-
uses: ./
51-
id: push
52-
with:
53-
image: ${{ steps.build_image.outputs.image }}
54-
tags: ${{ steps.build_image.outputs.tags }}
55-
registry: ${{ env.IMAGE_REGISTRY }}
56-
username: ${{ env.REGISTRY_USER }}
57-
password: ${{ env.REGISTRY_PASSWORD }}
58-
extra-args: |
59-
--disable-content-trust
60-
61-
- name: Echo outputs
62-
run: |
63-
echo "${{ toJSON(steps.push.outputs) }}"
10+
push-store-image:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: 'Checkout'
15+
uses: actions/checkout@main
16+
17+
- name: 'Login to GHCR'
18+
uses: docker/login-action@v1
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ github.token }}
23+
24+
- name: 'Build Image'
25+
run: docker build . --tag ghcr.io/hemantapkh/torrenthunt:latest
26+
27+
- push: 'Push to GHCR'
28+
run: docker push ghcr.io/hemantapkh/torrenthunt:latest

0 commit comments

Comments
 (0)