feat: first commit
This commit is contained in:
commit
ecb7899a97
15 changed files with 6603 additions and 0 deletions
56
.github/workflows/build-and-deploy.yml
vendored
Normal file
56
.github/workflows/build-and-deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# For information on GITHUB_TOKEN: https://docs.github.com/en/actions/concepts/security/github_token
|
||||
# For information on github.actor: https://github.com/orgs/community/discussions/62108
|
||||
|
||||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
env:
|
||||
CONTAINER_NAME: codered-astra
|
||||
CONTAINER_TAG: ghcr.io/${{ github.repository_owner }}/codered-astra:latest
|
||||
|
||||
jobs:
|
||||
# Set permissions for the job
|
||||
build:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
attestations: write
|
||||
id-token: write
|
||||
|
||||
name: Build Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }} # User that commits
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ env.CONTAINER_TAG }}
|
||||
|
||||
# WIP: For deployment
|
||||
deploy:
|
||||
name: Deploy Docker Image to Server
|
||||
runs-on: self-hosted
|
||||
needs: build
|
||||
steps:
|
||||
Loading…
Add table
Add a link
Reference in a new issue