forked from pallupz/covid-vaccine-booking
-
Notifications
You must be signed in to change notification settings - Fork 214
83 lines (70 loc) · 2.86 KB
/
main.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
72
73
74
75
76
77
78
79
80
81
82
83
# This is a basic workflow to help you get started with Actions
name: CI Windows EXE Build
# Controls when the action will run.
on:
push:
tags:
- v*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: fregante/setup-git-user@v1
# Set branch name
- name: Set branch name
run: |
$branchName = $Env:GITHUB_REF -replace "refs/heads/", ""
echo $branchName
# Install all required dependencies and pyinstaller to package code
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pyinstaller
# Package script and move to root folder
- name: Package Script to EXE
run: |
rm covid-vaccine-slot-booking.exe -ErrorAction Ignore
cd src
pyinstaller --onefile covid-vaccine-slot-booking.py
cd ..
move src\dist\covid-vaccine-slot-booking.exe .
# Push EXE file to release
- name: Upload windows executable to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: covid-vaccine-slot-booking.exe
tag: ${{ github.ref }}
# Push APK to release.
- name: Upload android package to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: CoWinOtpRetreiver.apk
tag: ${{ github.ref }}
docker-build:
runs-on: ubuntu-latest
name: Build and push to docker
steps:
- uses: actions/checkout@v2
- name: Run Docker
env:
TAG_NAME: ${{ github.ref }}
GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
GIT_USERNAME: ${{ github.repository }}
run: |
version=$(echo ${TAG_NAME/refs\/tags\/v/})
echo $GIT_PASSWORD | docker login -u $GIT_USERNAME --password-stdin https://docker.pkg.github.com
docker build --no-cache -t cowin:latest -f Dockerfile .
docker tag cowin:latest docker.pkg.github.com/bombardier-gif/covid-vaccine-booking/cowin:$version
docker tag cowin:latest docker.pkg.github.com/bombardier-gif/covid-vaccine-booking/cowin:latest
docker push docker.pkg.github.com/bombardier-gif/covid-vaccine-booking/cowin:$version
docker push docker.pkg.github.com/bombardier-gif/covid-vaccine-booking/cowin:latest