-
Notifications
You must be signed in to change notification settings - Fork 10
36 lines (30 loc) · 892 Bytes
/
docker.yml
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
name: Docker build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build the Docker image
run: docker build -t felix-image .
- name: Run the container
run: docker run --name felix-container felix-image
- name: Copy from container to host
run: docker cp felix-container:/root/felix/build .
- name: Get current date
id: build_date
run: echo "build_date=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Get current commit count
id: commit_count
run: echo "commit_count=$(git log --oneline | wc -l)" >> $GITHUB_ENV
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: felix-${{ env.build_date }}-${{ env.commit_count }}
path: build