ci(alpha): add image build for worker
This commit is contained in:
parent
8e19c8b0e8
commit
9efacb5797
3 changed files with 35 additions and 2 deletions
31
.github/workflows/alpha-release.yml
vendored
31
.github/workflows/alpha-release.yml
vendored
|
@ -26,6 +26,37 @@ jobs:
|
|||
tag_prefix: 'v'
|
||||
tag_suffix: '-alpha.${{ github.event.inputs.tag }}'
|
||||
|
||||
build-worker:
|
||||
runs-on: ubuntu-latest
|
||||
needs: create-tag
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push images
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./packages/worker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository_owner }}/worker:${{ needs.create-tag.outputs.tagname }}
|
||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/worker:buildcache
|
||||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/worker:buildcache,mode=max
|
||||
|
||||
build-images:
|
||||
runs-on: ubuntu-latest
|
||||
needs: create-tag
|
||||
|
|
|
@ -56,7 +56,7 @@ services:
|
|||
|
||||
tipi-worker:
|
||||
container_name: tipi-worker
|
||||
image: ghcr.io/runtipi/runtipi-worker:${TIPI_VERSION}
|
||||
image: ghcr.io/runtipi/worker:${TIPI_VERSION}
|
||||
user: root
|
||||
healthcheck:
|
||||
test: ['CMD', 'curl', '-f', 'http://localhost:3000/healthcheck']
|
||||
|
|
|
@ -36,7 +36,9 @@ describe('test: app executors', () => {
|
|||
it('should return error if compose script fails', async () => {
|
||||
// arrange
|
||||
const randomError = faker.system.fileName();
|
||||
const spy = vi.spyOn(dockerHelpers, 'compose').mockImplementation(() => Promise.resolve({ stdout: '', stderr: randomError }));
|
||||
const spy = vi.spyOn(dockerHelpers, 'compose').mockImplementation(() => {
|
||||
throw new Error(randomError);
|
||||
});
|
||||
const config = createAppConfig({}, false);
|
||||
|
||||
// act
|
||||
|
|
Loading…
Reference in a new issue