Skip to content

Commit a4b9de7

Browse files
author
Maksim Litvinov
committed
add deploy task
1 parent b4879f8 commit a4b9de7

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

.github/workflows/main.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-node@v3
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
1919
with:
2020
node-version: '20'
2121
cache: 'npm'
@@ -27,3 +27,29 @@ jobs:
2727
make setup
2828
bin/rails assets:precompile
2929
make test
30+
31+
deploy:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
if: ${{ github.event_name == 'push' }}
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- uses: docker/setup-buildx-action@v3
40+
41+
- name: Log in to GitHub Container Registry
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Build and push
49+
uses: docker/build-push-action@v6
50+
with:
51+
context: .
52+
push: true
53+
cache-from: ghcr.io/${{ github.repository }}:latest
54+
cache-to: type=inline
55+
tags: ghcr.io/${{ github.repository }}:latest

0 commit comments

Comments
 (0)