Run/compile cmd #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build frontend app in /frontend/public path and force push it | |
# After force push run digital ocean rebuild static | |
on: | |
push: | |
paths: | |
- 'sandbox/**' | |
- '.github/workflows/sandbox-registry.yaml' | |
branches: | |
- main | |
pull_request: | |
paths: | |
- 'sandbox/**' | |
- '.github/workflows/sandbox-registry.yaml' | |
branches: | |
- main | |
jobs: | |
sandbox-build-and-push: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_USERNAME: codiew | |
IMAGE_NAME: codenire-sandbox | |
steps: | |
# Проверка кода из репозитория | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Логин в Docker Hub | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ env.IMAGE_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# Сборка Docker-образа | |
- name: Build Docker image | |
run: | | |
cd sandbox | |
docker build -t ${{ env.IMAGE_USERNAME }}/${{ env.IMAGE_NAME }}:latest . | |
# Публикация Docker-образа | |
- name: Push Docker image | |
run: | | |
cd sandbox | |
docker push ${{ env.IMAGE_USERNAME }}/${{ env.IMAGE_NAME }}:latest |