-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
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,48 @@ | ||
name: Build and publish the production container image to the GitHub Registry | ||
|
||
# Run this workflow every time on every push to the branch `release`. | ||
on: | ||
push: | ||
branches: ['feature/runnable-container'] | ||
|
||
env: | ||
IMAGE_NAME: imap-backup | ||
REGISTRY_USER: ${{ github.actor }} | ||
REGISTRY_PASSWORD: ${{ github.token }} | ||
REGISTRY: ghcr.io/${{ github.repository_owner }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Image | ||
# https://github.com/marketplace/actions/buildah-build | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ env.IMAGE_NAME }} | ||
tags: latest ${{ github.sha }} | ||
extra-args: | | ||
--ignorefile ./container/.containerignore | ||
containerfiles: | | ||
./container/Containerfile | ||
labels: | | ||
${{ env.IMAGE_NAME }}:latest | ||
- name: Publish Image | ||
# https://github.com/marketplace/actions/push-to-registry | ||
id: push-to-registry | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: ${{ secrets.REGISTRY }} | ||
username: ${{ secrets.REGISTRY_USER }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} |
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,6 @@ | ||
* | ||
!bin/imap-backup | ||
!Gemfile | ||
!imap-backup.gemspec | ||
!lib | ||
!LICENSE |
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,12 @@ | ||
FROM docker.io/library/ruby:3.2.2-alpine3.18 | ||
|
||
WORKDIR /app | ||
|
||
RUN gem install bundler --version "2.4.21" | ||
COPY . . | ||
RUN \ | ||
BUNDLE_WITHOUT=development bundle install --no-binstubs && \ | ||
rm -f /usr/local/bundle/bin/imap-backup | ||
ENV PATH=${PATH}:/app/bin | ||
|
||
CMD ["imap-backup", "backup", "-c", "/config/imap-backup.json"] |