Some checks failed
Docker Deploy / build-and-push (push) Failing after 43s
51 lines
1.8 KiB
YAML
51 lines
1.8 KiB
YAML
name: Docker Deploy
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- 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
|
|
with:
|
|
registry: ${{ secrets.REPO_HOST }}
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.DEPLOY_TOKEN }}
|
|
|
|
- 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
|