-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use custom action for multi stage build and publish
- Loading branch information
1 parent
0fb9f2f
commit 18b369e
Showing
3 changed files
with
47 additions
and
102 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Multi stage build and publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
env: | ||
IMAGE_REGISTRY: ghcr.io/${{ github.repository }} | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build and publish | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# This step MUST be performed before multistage-docker-build | ||
- name: Auth to GH registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: lowercase IMAGE_REGISTRY | ||
run: | | ||
echo "IMAGE_REGISTRY=${IMAGE_REGISTRY@L}" >> ${GITHUB_ENV} | ||
- uses: firehed/multistage-docker-build-action@v1 | ||
id: build | ||
with: | ||
context: ./rusty-fedora.container | ||
dockerfile: rusty-fedora.container/Containerfile | ||
repository: ${{ env.IMAGE_REGISTRY }} | ||
stages: builder | ||
server-stage: fedora-oxidized.toolbox | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,17 @@ RUN cargo install $(cat useful-crates) | |
RUN rm /useful-crates | ||
|
||
|
||
FROM quay.io/toolbx-images/fedora-toolbox:39 | ||
FROM quay.io/toolbx-images/fedora-toolbox:39 as fedora-oxidized.toolbox | ||
|
||
ARG NAME=rusty-fedora.toolbx | ||
ARG NAME=fedora-oxidized.toolbox | ||
ARG VERSION=39 | ||
LABEL com.github.containers.toolbox="true" \ | ||
com.redhat.component="$NAME" \ | ||
name="$NAME" \ | ||
version="$VERSION" \ | ||
usage="This image is meant to be used with the toolbx or distrobox command" \ | ||
summary="Rusted image based on Fedora Toolbx base container" \ | ||
maintainer="nain <[email protected]>" | ||
summary="Rusted image based on Fedora Toolbox base container" \ | ||
maintainer="nain <no-reply@you-are-on-your-own-for-now.alt>" | ||
|
||
RUN mkdir -p /opt/cargo/bin | ||
COPY --from=builder /usr/local/cargo/bin/* /opt/cargo/bin/ | ||
|