-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (70 loc) · 2.12 KB
/
main.yml
File metadata and controls
74 lines (70 loc) · 2.12 KB
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
72
73
name: Python application
on:
push:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11.4
uses: actions/setup-python@v4
with:
python-version: "3.11.4"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi #pytests could go under this step
docker:
needs: build
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: sadminriley/images:app-${{ github.run_number }}
modifygit:
needs: docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: changing the deployment of git repo
with:
repository: 'sadminriley/argocd-flask'
token: ${{ secrets.GIT_PASSWORD }}
- name: modify the image
run: |
git config user.email riley@fasterdevops.com
git config user.name Riles
pwd
cat deployment.yaml
pwd
sed -i "s+sadminriley/images.*+sadminriley/images:app-$RUN_NUMBER+g" deployment.yaml
cat deployment.yaml
git add .
git commit -m 'Done by Github Actions Job changemanifest: ${{ github.run_number }}'
git push origin main
env:
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GIT_PASSWORD: ${{ secrets.GIT_PASSWORD }}
RUN_NUMBER: ${{ github.run_number }}