Skip to content

Commit

Permalink
add gh actions build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmostafa committed Nov 25, 2024
1 parent 60e4d54 commit 2c810ff
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build

on:
push:
branches:
- main

env:
IMAGE: ${{ secrets.IMAGE_URL }}
PAT: ${{ secrets.PAT }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Registry login
run: echo $PAT | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin

- name: Pull Docker Image
run: docker pull $IMAGE/api:latest

- name: Tag Docker Image
run: docker build . --tag $IMAGE/api:latest --cache-from $IMAGE:latest

- name: Push Docker Image
run: docker push $IMAGE/api:latest

0 comments on commit 2c810ff

Please sign in to comment.