-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.15 KB
/
ci-cd.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
# .github/workflows/ci-cd.yml - comment bump
name: CI/CD
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Run npm audit fix
run: npm audit fix
- name: Compile TypeScript
run: npx tsc
- name: Run tests
run: npm test
- name: Docker Login
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build and Push Docker Image
run: |
docker build -t heavygee/hello-dalle-discordbot:latest .
docker tag heavygee/hello-dalle-discordbot:latest heavygee/hello-dalle-discordbot:$GITHUB_SHA
docker push heavygee/hello-dalle-discordbot:latest
docker push heavygee/hello-dalle-discordbot:$GITHUB_SHA
- name: Create GitHub Release
run: |
gh release create "$GITHUB_SHA" --title "Build $GITHUB_SHA" --notes "Automated build release"