feat: re-enable integrations next (#9) #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Pages | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
env: | |
REACT_APP_FARO_URL: ${{ secrets.REACT_APP_FARO_URL }} | |
REACT_APP_CONVERT_ENDPOINT: 'https://alloy-configurator-wcwoo.ondigitalocean.app/convert' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
packages: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
publish-backend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: "backend/alloy/go.mod" | |
cache: true | |
- uses: ko-build/[email protected] | |
with: | |
version: v0.15.1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Prepare | |
run: | | |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV | |
mkdir backend/alloy/convert-web | |
cp backend/main.go backend/alloy/convert-web | |
- name: Build and push | |
working-directory: backend/alloy/convert-web | |
run: | | |
export KO_DOCKER_REPO=ghcr.io/grafana/alloy-configurator-backend | |
ko build --sbom=none --bare --platform linux/arm64,linux/arm/v7,linux/amd64 -t ${{ github.ref_name }} \ | |
--image-label org.opencontainers.image.title=alloy-configurator-backend \ | |
--image-label org.opencontainers.image.description="Backend for the alloy-configurator" \ | |
--image-label org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }} \ | |
--image-label org.opencontainers.image.revision=${{ github.sha }} \ | |
--image-label org.opencontainers.image.version=${{ github.ref_name }} \ | |
--image-label org.opencontainers.image.created=${{ env.BUILD_DATE }} | |
deploy-frontend: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm ci --force # needed for react-hook-form to play nicely with newer react versions | |
- run: npm run-script build | |
# Deployment | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload entire repository | |
path: 'build' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |