Skip to content

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set image version (tag)
id: image_version
run: echo "gitsha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: login to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: sarahabuirmeileh
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ghcr.io/sarahabuirmeileh/serve-and-shine:${{ steps.image_version.outputs.gitsha }}
- name: Puplish docker image
run: docker push ghcr.io/sarahabuirmeileh/serve-and-shine:${{ steps.image_version.outputs.gitsha }}
- name: configer docker host
uses: khaledez/configure-docker-host@v1
with:
host: 13.43.121.108
user: github
ssh-private-key: ${{ secrets.DEPLOYMENT_KEY }}
- name: deploy
run: docker compose -f docker-compose-prod.yml up -d
env:
DB_PASSWORD: ${{ secrets.DB_PASSWORD}}
GIT_VERSISON: ${{steps.image_version.outputs.gitsha}}
SECRET_KEY: ${{ secrets.SECRET_KEY}}
DB_HOST: ${{ secrets.DB_HOST}}
DB_PORT: ${{ secrets.DB_PORT}}
DB_USERNAME: ${{ secrets.DB_USERNAME}}
DB_NAME: ${{ secrets.DB_NAME}}
AWS_BUCKET_NAME: ${{ secrets.AWS_BUCKET_NAME}}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
AWS_REGION: ${{ secrets.AWS_REGION}}
AWS_CERTIFICATES_BUCKET_NAME: ${{ sercrets.AWS_CERTIFICATES_BUCKET_NAME}}

Check failure on line 58 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Docker Image CI

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 58, Col: 39): Unrecognized named-value: 'sercrets'. Located at position 1 within expression: sercrets.AWS_CERTIFICATES_BUCKET_NAME
- name: print logs
if: always()
run: docker compose logs
- name: Run Migrations
run: |
docker compose exec app npx typeorm-ts-node-esm migration:run -d ./src/db/dataSource.ts &&
docker compose exec app mv ./src/db/migrations/1697005494066-CreateRoles.ts ./src/db/migration &&
docker compose exec app npx typeorm-ts-node-esm migration:run -d ./src/db/dataSource.ts &&
docker compose exec app mv ./src/db/migrations/1697005554406-RootUser.ts ./src/db/migration &&
docker compose exec app npx typeorm-ts-node-esm migration:run -d ./src/db/dataSource.ts