-
Notifications
You must be signed in to change notification settings - Fork 28
71 lines (57 loc) · 1.9 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build and Push
on:
push:
branches:
- main
workflow_dispatch:
env:
# Change these values if you have forked it for your own works
# Use Lowercase vaue of your Username
GITHUB_USERNAME: sushrut1101
GITHUB_EMAIL: [email protected]
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# Image name and tag. MUST be lowercase
IMAGE_NAME: docker
jobs:
arch:
runs-on: ubuntu-latest
env:
IMAGE_TAG: arch
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configuring git
run: |
git config --global user.name $GITHUB_USERNAME
git config --global user.email $GITHUB_EMAIL
- name: Logging in to Docker
run: |
echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin
- name: Building the Image
run: |
docker build -t ghcr.io/${GITHUB_USERNAME}/${IMAGE_NAME}:${IMAGE_TAG} -f arch/Dockerfile .
echo -e "\033[0;32m""### Build Completed Successfully!""\033[0m"
- name: Pushing the Image
run: |
docker push ghcr.io/${GITHUB_USERNAME}/${IMAGE_NAME}:${IMAGE_TAG}
fedora:
runs-on: ubuntu-latest
env:
IMAGE_TAG: latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configuring git
run: |
git config --global user.name $GITHUB_USERNAME
git config --global user.email $GITHUB_EMAIL
- name: Logging in to Docker
run: |
echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin
- name: Building the Image
run: |
docker build -t ghcr.io/${GITHUB_USERNAME}/${IMAGE_NAME}:${IMAGE_TAG} -f fedora/Dockerfile .
echo -e "\033[0;32m""### Build Completed Successfully!""\033[0m"
- name: Pushing the Image
run: |
docker push ghcr.io/${GITHUB_USERNAME}/${IMAGE_NAME}:${IMAGE_TAG}