Skip to content

Commit

Permalink
Merge pull request #386 from adrianbielawski/docker-deploy
Browse files Browse the repository at this point in the history
Docker deploy
  • Loading branch information
D3X authored Feb 2, 2024
2 parents dc12a7c + e4ef123 commit 58be2e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches: [master]
pull_request:
branches: [master]
repository_dispatch:
types: [deploy]

jobs:
build:
Expand Down Expand Up @@ -47,25 +45,26 @@ jobs:
path: dist/
if-no-files-found: error
deploy:
if: github.event_name == 'push' || github.event_name == 'repository_dispatch'
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Get artifacts
uses: actions/download-artifact@v2
with:
name: build
path: build

- name: Deploy to server
uses: easingthemes/ssh-deploy@v2.0.7
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
REMOTE_HOST: 'burek.it'
REMOTE_USER: 'catalogues'
TARGET: 'catalogues-fe'
ARGS: '-rltgoDzvO'
SOURCE: 'build/'
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.burek.it
username: ${{ secrets.BUREK_DOCKER_USERNAME }}
password: ${{ secrets.BUREK_DOCKER_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: docker.burek.it/catalogues-frontend:latest
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM nginx
COPY dist /usr/share/nginx/html

0 comments on commit 58be2e6

Please sign in to comment.