Skip to content

Commit

Permalink
move proxy build to separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
its-felix committed May 26, 2024
1 parent 1102368 commit 23ed615
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 40 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build_proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Build Proxy'

on:
push:
branches:
- 'main'
paths:
- 'go/proxy/**'

env:
WORKSPACE_ARTIFACT_PROXY: 'explore_flights_proxy_artifact'

jobs:
build_and_test_proxy:
name: 'Build and test proxy'
runs-on: ubuntu-latest
strategy:
matrix:
goos: [ 'linux', 'darwin' ]
goarch: [ 'arm64', 'amd64' ]
suffix: [ '' ]
include:
- goos: 'windows'
goarch: 'amd64'
suffix: '.exe'
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup go'
uses: actions/setup-go@v5
with:
go-version-file: 'go/proxy/go.mod'
cache-dependency-path: 'go/proxy/go.sum'
- name: 'Test'
working-directory: 'go/proxy'
run: 'go test ./...'
- name: 'Build'
working-directory: 'go/proxy'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: '0'
run: 'go build -o proxy-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }} -tags "prod"'
- name: 'Make executable'
working-directory: 'go/proxy'
run: 'chmod +x proxy-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}'
- name: 'Store proxy artifact'
uses: actions/upload-artifact@v4
with:
name: '${{ env.WORKSPACE_ARTIFACT_PROXY }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}'
path: 'go/proxy/proxy-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}'
40 changes: 0 additions & 40 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
env:
WORKSPACE_ARTIFACT_API: 'explore_flights_api_artifact'
WORKSPACE_ARTIFACT_CRON: 'explore_flights_cron_artifact'
WORKSPACE_ARTIFACT_PROXY: 'explore_flights_proxy_artifact'
WORKSPACE_ARTIFACT_UI: 'explore_flights_ui_artifact'
WORKSPACE_ARTIFACT_CDK: 'explore_flights_cdk_artifact'

Expand Down Expand Up @@ -75,45 +74,6 @@ jobs:
path: 'go/cron/bootstrap'
retention-days: 1

build_and_test_proxy:
name: 'Build and test proxy'
runs-on: ubuntu-latest
strategy:
matrix:
goos: ['linux', 'darwin']
goarch: ['arm64', 'amd64']
suffix: ['']
include:
- goos: 'windows'
goarch: 'amd64'
suffix: '.exe'
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup go'
uses: actions/setup-go@v5
with:
go-version-file: 'go/proxy/go.mod'
cache-dependency-path: 'go/proxy/go.sum'
- name: 'Test'
working-directory: 'go/proxy'
run: 'go test ./...'
- name: 'Build'
working-directory: 'go/proxy'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: '0'
run: 'go build -o proxy-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }} -tags "prod"'
- name: 'Make executable'
working-directory: 'go/proxy'
run: 'chmod +x proxy-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}'
- name: 'Store proxy artifact'
uses: actions/upload-artifact@v4
with:
name: '${{ env.WORKSPACE_ARTIFACT_PROXY }}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}'
path: 'go/proxy/proxy-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}'

build_ui:
name: 'Build UI'
runs-on: ubuntu-latest
Expand Down

0 comments on commit 23ed615

Please sign in to comment.