Skip to content

Commit

Permalink
Changing target platform to arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNewCivilian committed Oct 31, 2023
1 parent 888ac53 commit 81b5b8f
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 79 deletions.
91 changes: 46 additions & 45 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,65 @@
name: Deploy to development

on:
workflow_dispatch
on: workflow_dispatch

jobs:
set-version:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set version
run: |
sed -i "s/VITE_VERSION=.*/VITE_VERSION=\"${GITHUB_SHA:0:8}\"/" openlineplanner/.env.development
- uses: EndBug/add-and-commit@v9
with:
author_name: Github Actions
author_email: hi@xatellite.space
message: 'Set current version in env file'
- uses: actions/checkout@v3
- name: Set version
run: |
sed -i "s/VITE_VERSION=.*/VITE_VERSION=\"${GITHUB_SHA:0:8}\"/" openlineplanner/.env.development
- uses: EndBug/add-and-commit@v9
with:
author_name: Github Actions
author_email: hi@xatellite.space
message: "Set current version in env file"
build:
permissions:
packages: write
needs: set-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set version
run: |
echo "VERSION=${GITHUB_SHA:0:8}" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: openlineplanner
push: true
tags: ghcr.io/xatellite/openlineplanner/olp-frontend:${{ env.VERSION }}
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: openlineplanner-backend
push: true
tags: ghcr.io/xatellite/openlineplanner/olp-backend:${{ env.VERSION }}
- uses: actions/checkout@v3
- name: Set version
run: |
echo "VERSION=${GITHUB_SHA:0:8}" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: openlineplanner
push: true
platforms: linux/arm64
tags: ghcr.io/xatellite/openlineplanner/olp-frontend:${{ env.VERSION }}
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: openlineplanner-backend
push: true
platforms: linux/arm64
tags: ghcr.io/xatellite/openlineplanner/olp-backend:${{ env.VERSION }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Set version
run: |
echo "VERSION=${GITHUB_SHA:0:8}" >> "$GITHUB_ENV"
- name: Trigger pipeline
run: |
curl -vvv -X POST \
--fail \
-F token=${{ secrets.GITLAB_TOKEN }} \
-F "ref=main" \
-F "variables[TEST]=true" \
-F "variables[VERSION]=${VERSION}" \
https://gitlab.com/api/v4/projects/46252495/trigger/pipeline
- name: Set version
run: |
echo "VERSION=${GITHUB_SHA:0:8}" >> "$GITHUB_ENV"
- name: Trigger pipeline
run: |
curl -vvv -X POST \
--fail \
-F token=${{ secrets.GITLAB_TOKEN }} \
-F "ref=main" \
-F "variables[TEST]=true" \
-F "variables[VERSION]=${VERSION}" \
https://gitlab.com/api/v4/projects/46252495/trigger/pipeline
70 changes: 36 additions & 34 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,43 @@ jobs:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set version
run: |
echo "VERSION=$(grep -oP 'VITE_VERSION="\K\d+\.\d+\.\d+' openlineplanner/.env.production)" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: openlineplanner
push: true
tags: ghcr.io/xatellite/openlineplanner/olp-frontend:${{ env.VERSION }}
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: openlineplanner-backend
push: true
tags: ghcr.io/xatellite/openlineplanner/olp-backend:${{ env.VERSION }}
- uses: actions/checkout@v3
- name: Set version
run: |
echo "VERSION=$(grep -oP 'VITE_VERSION="\K\d+\.\d+\.\d+' openlineplanner/.env.production)" >> "$GITHUB_ENV"
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: openlineplanner
push: true
platforms: linux/arm64
tags: ghcr.io/xatellite/openlineplanner/olp-frontend:${{ env.VERSION }}
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: openlineplanner-backend
push: true
platforms: linux/arm64
tags: ghcr.io/xatellite/openlineplanner/olp-backend:${{ env.VERSION }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Set version
run: |
echo "VERSION=$(grep -oP 'VITE_VERSION="\K\d+\.\d+\.\d+' openlineplanner/.env.production)" >> "$GITHUB_ENV"
- name: Trigger pipeline
run: |
curl -vvv -X POST \
--fail \
-F token=${{ secrets.GITLAB_TOKEN }} \
-F "ref=main" \
-F "variables[TEST]=false" \
-F "variables[VERSION]=${VERSION}" \
https://gitlab.com/api/v4/projects/46252495/trigger/pipeline
- name: Set version
run: |
echo "VERSION=$(grep -oP 'VITE_VERSION="\K\d+\.\d+\.\d+' openlineplanner/.env.production)" >> "$GITHUB_ENV"
- name: Trigger pipeline
run: |
curl -vvv -X POST \
--fail \
-F token=${{ secrets.GITLAB_TOKEN }} \
-F "ref=main" \
-F "variables[TEST]=false" \
-F "variables[VERSION]=${VERSION}" \
https://gitlab.com/api/v4/projects/46252495/trigger/pipeline

0 comments on commit 81b5b8f

Please sign in to comment.