Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update registries and improve GHA #33

Merged
merged 17 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/azure-swa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
- name: Create .env file
uses: SpicyPizza/create-envfile@v1
with:
envkey_REACT_APP_SITE_NAME: ${{ secrets.REACT_APP_SITE_NAME }}
envkey_REACT_APP_REPO_URL: ${{ secrets.REACT_APP_REPO_URL }}
envkey_REACT_APP_API_URL: ${{ secrets.REACT_APP_API_URL }}
envkey_REACT_APP_SITE_NAME: ${{ vars.REACT_APP_SITE_NAME }}
envkey_REACT_APP_REPO_URL: ${{ vars.REACT_APP_REPO_URL }}
envkey_REACT_APP_API_URL: ${{ vars.REACT_APP_API_URL }}
directory: swa

- name: Build And Deploy
Expand Down
50 changes: 45 additions & 5 deletions .github/workflows/bsod-api-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

env:
REGISTRY: ghcr.io
REPO: pipeittodevnull
IMAGE: bsod-api
REPO: r-techsupport
IMAGE: webdbg-api

jobs:
build_and_push:
runs-on: windows-2022
permissions:
contents: write
pull-requests: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true

Expand All @@ -31,5 +36,40 @@ jobs:

- name: Build and push
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE}}:latest api/
docker push ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE}}:latest
$SHA = "${{ github.sha }}"[0..6] -join ''

if ("${{ github.ref }}" -eq 'refs/heads/main') {
$TAG = 'latest'
} else {
$TAG = 'devel'
}

echo "SHA=$SHA" >> $env:GITHUB_ENV
echo "TAG=$TAG" >> $env:GITHUB_ENV

Write-Host "Using tag: $TAG"
Write-Host "Using SHA: $SHA"

docker build -t `
${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:$TAG `
-t ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:$SHA `
api/
docker push ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:$TAG
docker push ${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:$SHA

- name: Log out from the Container registry
run: docker logout ${{ env.REGISTRY }}

- name: Comment on the PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
const tagImage = '${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ env.TAG }}';
const shaImage = '${{ env.REGISTRY }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ env.SHA }}';
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `Docker images have been built and pushed:\n- \`${tagImage}\`\n- \`${shaImage}\``
});
2 changes: 1 addition & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ EXPOSE 3000
# Start the application
CMD ["node", "api.js"]

LABEL org.opencontainers.image.source https://github.com/PipeItToDevNull/bsod-api
LABEL org.opencontainers.image.source https://github.com/r-Techsupport/WebDBG
LABEL org.opencontainers.image.description A BSOD debug API using WinDebug-Container
24 changes: 0 additions & 24 deletions template.json

This file was deleted.

Loading