Skip to content

Commit 5482890

Browse files
[setup](build): most from @RalphHightower, others
Signed-off-by: Ralph Hightower <[email protected]>
1 parent 89f72ea commit 5482890

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This workflow updates the docker container which has context and
2+
# pandoc installed, and on which the resume documents are built. The
3+
# workflow runs whenever the dockerfile is changed, and updates the
4+
# container image in the Github Packages registry.
5+
6+
name: Publish Docker Image
7+
8+
# Controls when the action will run.
9+
on:
10+
# Triggers the workflow on push events but only for the master branch
11+
push:
12+
branches: [ master ]
13+
paths-ignore:
14+
- 'markdown/**'
15+
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
18+
19+
env:
20+
REGISTRY: ghcr.io
21+
IMAGE_NAME: ${{ github.repository }}
22+
23+
jobs:
24+
push_to_registry:
25+
name: Push Docker image to GitHub Packages
26+
runs-on: ubuntu-latest
27+
permissions:
28+
packages: write
29+
contents: read
30+
steps:
31+
- name: Check out the repo
32+
uses: actions/checkout@v2
33+
34+
- name: Log in to the Container registry
35+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Extract metadata (tags, labels) for Docker
42+
id: meta
43+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
44+
with:
45+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
46+
47+
- name: Build and Push to GitHub Packages
48+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
49+
with:
50+
context: .
51+
file: .docker/resume.dockerfile
52+
push: true
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: build-resume
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [ master ]
10+
paths:
11+
- 'markdown/**'
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
jobs:
17+
build-resume:
18+
runs-on: ubuntu-latest
19+
steps:
20+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
- uses: actions/checkout@v2
22+
23+
- name: Test directory contents
24+
run: 'ls -al'
25+
26+
- name: Build resume
27+
uses: ./actions
28+
29+
- name: Upload a Build Artifact
30+
uses: actions/[email protected]
31+
with:
32+
# Artifact name
33+
name: Resume PDF # optional, default is artifact
34+
# A file, directory or wildcard pattern that describes what to upload
35+
path: output/*.pdf
36+

0 commit comments

Comments
 (0)