Skip to content

Commit

Permalink
ci(github acitions): try to build images using linux machines
Browse files Browse the repository at this point in the history
  • Loading branch information
anteqkois committed May 5, 2024
1 parent 3afe200 commit 33a374a
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: deploy-changed-apps

on:
workflow_dispatch
# on:
# push:
# branches:
# - master
# workflow_dispatch
on:
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
name: Check affected apps
name: Build images
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -36,19 +36,25 @@ jobs:
key: npm-dependencies-${{ hashFiles('package.json') }}
- name: Build base image
run: npm run docker-base
- name: Tag image
- name: Tag base image
run:
docker tag sample/my-page \
registry.digitalocean.com/my-sample-registry/my-sample-page:${{github.event.inputs.version }}
docker tag linkerry/base \
registry.digitalocean.com/linkerry/base:latest
# Install doctl.
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log in to DO Container Registry
run: doctl registry login --expiry-seconds 600
- run: npx [email protected] affected -t docker-compose --base=origin/master~1 --head=origin/master
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Push image to DO Container Registry
run: docker push registry.digitalocean.com/linkerry/linkerry/base:latest
- name: Build image for web
run: docker build -t linkerry/web -f ./apps/web/Dockerfile . --platform=linux/amd64
- name: Tag web image
run:
docker tag linkerry/web \
registry.digitalocean.com/linkerry/web:latest
- name: Push image to DO Container Registry
run: docker push registry.digitalocean.com/linkerry/web:latest
# - run: npx [email protected] affected -t docker-compose --base=origin/master~1 --head=origin/master

0 comments on commit 33a374a

Please sign in to comment.