This commit is contained in:
37
.github/workflows/deploy.yml
vendored
37
.github/workflows/deploy.yml
vendored
@@ -14,8 +14,19 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
- name: Install mise
|
||||
run: |
|
||||
curl -sSL https://mise.run | sh
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
|
||||
|
||||
- name: Install railpack
|
||||
run: mise install ubi:railwayapp/railpack@latest
|
||||
|
||||
- name: Start BuildKit
|
||||
run: |
|
||||
docker run --rm --privileged -d --name buildkit moby/buildkit
|
||||
echo "BUILDKIT_HOST=docker-container://buildkit" >> $GITHUB_ENV
|
||||
|
||||
- name: Login to Container Registry
|
||||
uses: docker/login-action@v2
|
||||
@@ -24,12 +35,16 @@ jobs:
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.DEPLOY_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||
- name: Build with RailPack
|
||||
run: |
|
||||
# Build image using RailPack
|
||||
railpack build . --tag ${{ github.event.repository.name }}:latest
|
||||
|
||||
# Tag image
|
||||
docker tag ${{ github.event.repository.name }}:latest ${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||
docker tag ${{ github.event.repository.name }}:latest ${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||
|
||||
- name: Push to Registry
|
||||
run: |
|
||||
docker push ${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||
docker push ${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||
|
||||
Reference in New Issue
Block a user