Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
portal-backend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HBP Medical Informatics Platform
portal-backend
Commits
19cc92c4
Commit
19cc92c4
authored
2 years ago
by
ThanKarab
Browse files
Options
Downloads
Patches
Plain Diff
Github actions for build/push in dockerhub.
parent
ba8216be
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!40
Dev/automated build and push actions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/publish_images.yml
+55
-0
55 additions, 0 deletions
.github/workflows/publish_images.yml
with
55 additions
and
0 deletions
.github/workflows/publish_images.yml
0 → 100644
+
55
−
0
View file @
19cc92c4
name
:
Publish images
on
:
release
:
types
:
[
published
]
jobs
:
build_and_push
:
name
:
Build image and push to dockerhub
runs-on
:
ubuntu-latest
steps
:
-
name
:
Check out repository
uses
:
actions/checkout@v2
-
name
:
Set up Docker Buildx
uses
:
docker/setup-buildx-action@v1
-
name
:
Log in to Docker Hub
uses
:
docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with
:
username
:
${{ secrets.DOCKER_USERNAME }}
password
:
${{ secrets.DOCKER_PASSWORD }}
-
name
:
Extract metadata (tags, labels) for Docker
id
:
meta
uses
:
docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with
:
images
:
hbpmip/portal-backend
-
name
:
Load cached image
uses
:
actions/cache@v2
with
:
path
:
/tmp/.buildx-cache/portal-backend
key
:
buildx-backend
restore-keys
:
buildx-backend
-
name
:
Build and Push image to dockerhub
uses
:
docker/build-push-action@v2
with
:
context
:
.
file
:
./Dockerfile
push
:
true
tags
:
${{ steps.meta.outputs.tags }}
labels
:
${{ steps.meta.outputs.labels }}
cache-from
:
type=local,src=/tmp/.buildx-cache/portal-backend
cache-to
:
type=local,dest=/tmp/.buildx-cache-new/portal-backend
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
-
name
:
Move Docker images cache
run
:
|
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment