Skip to content

Commit 922da3f

Browse files
committed
updating cicd.yml to support automated deployments
1 parent 8c90717 commit 922da3f

File tree

1 file changed

+14
-91
lines changed

1 file changed

+14
-91
lines changed

.github/workflows/cicd.yml

+14-91
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,25 @@
1-
name: Build & Publish
1+
name: "[crdh] Build, Release, Deploy"
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- "main"
78
- "preview"
89

9-
env:
10-
REGISTRY: ghcr.io
11-
IMAGE_NAME: "ghcr.io/${{ github.repository }}"
12-
1310
jobs:
14-
build:
15-
runs-on: ubuntu-latest
16-
17-
permissions:
18-
packages: write
19-
20-
steps:
21-
- uses: actions/checkout@v3
22-
23-
- name: Login to GitHub Container Registry
24-
uses: docker/login-action@v2
25-
with:
26-
username: ${{ github.repository_owner }}
27-
password: ${{ secrets.GITHUB_TOKEN }}
28-
registry: ${{ env.REGISTRY }}
29-
30-
- name: Build and Push Docker Image for Local Dev
31-
uses: docker/build-push-action@v4
32-
with:
33-
context: .
34-
push: true
35-
tags: "${{ env.IMAGE_NAME }}:latest"
36-
platforms: linux/amd64
37-
38-
- name: Build Docker Image(devl)
39-
if: github.ref == 'refs/heads/preview'
40-
uses: docker/build-push-action@v4
41-
with:
42-
context: .
43-
push: false
44-
tags: "${{ env.IMAGE_NAME }}:latest"
45-
platforms: linux/amd64
46-
build-args: |
47-
configfile=_config-dev.yml
48-
49-
- name: Build Docker Image (prod)
50-
if: github.ref == 'refs/heads/main'
51-
uses: docker/build-push-action@v4
52-
with:
53-
context: .
54-
push: false
55-
tags: "${{ env.IMAGE_NAME }}:latest"
56-
platforms: linux/amd64
57-
build-args: |
58-
configfile=_config-production.yml
59-
60-
- name: Extract build artifact from docker image
61-
uses: shrink/actions-docker-extract@v2
62-
id: extract
63-
with:
64-
image: "${{ env.IMAGE_NAME }}:latest"
65-
path: /usr/share/nginx/html/
66-
67-
- name: Archive build artifact
68-
run: tar czvf dist.tar.gz -C ${{ steps.extract.outputs.destination }}/html .
69-
70-
- name: Upload build artifact
71-
uses: actions/upload-artifact@v4
72-
with:
73-
path: ./dist.tar.gz
74-
name: dist
75-
76-
release:
77-
needs: build
78-
uses: chnm/.github/.github/workflows/create-release.yml@main
11+
jekyll-build-release-deploy:
12+
uses: chnm/.github/.github/workflows/jekyll--build-release-deploy.yml@main
7913
secrets: inherit
8014
with:
81-
github-run-id: "${{ github.run_id }}"
82-
github-workflow: "${{ github.workflow }}"
83-
github-workflow-ref: "${{ github.workflow_ref }}"
84-
github-workflow-sha: "${{ github.workflow_sha }}"
85-
github-workspace: "${{ github.workspace }}"
86-
github-repository: "${{ github.repository }}"
87-
github-repository-owner: "${{ github.repository_owner }}"
88-
github-repository-name: "${{ github.event.repository.name }}"
89-
github-repository-url: "${{ github.repository-url }}"
90-
github-action-ref: "${{ github.action_ref }}"
91-
github-event-name: "${{ github.event_name }}"
92-
github-actor: "${{ github.actor }}"
93-
github-triggering-actor: "${{ github.triggering_actor }}"
94-
github-base-ref: "${{ github.base_ref }}"
95-
github-ref-name: "${{ github.ref_name }}"
96-
github-ref-type: "${{ github.ref_type }}"
97-
github-ref: "${{ github.ref }}"
98-
github-sha: "${{ github.sha }}"
99-
build-artifact-name: "dist"
100-
release-artifact-tarball-filename: "dist.tar.gz"
15+
container-registry: "ghcr.io"
16+
container-image-name: "crdh"
17+
context-root: "."
18+
devl-url: "https://dev.crdh.rrchnm.org"
19+
prod-url: "https://crdh.rrchnm.org"
20+
21+
build-artifact-name: "crdh"
10122
release-tag-name-type: "iso"
102-
23+
24+
website-devl-fqdn: "dev.crdh.rrchnm.org"
25+
website-prod-fqdn: "crdh.rrchnm.org"

0 commit comments

Comments
 (0)