Enhance deployment workflow by saving Docker image as a tarball and uploading it as an artifact. Update AdminPage to provide user feedback for unsupported Docker export functionality.
Some checks failed
Deploy / build-and-deploy (push) Failing after 0s
Some checks failed
Deploy / build-and-deploy (push) Failing after 0s
This commit is contained in:
@@ -18,7 +18,16 @@ jobs:
|
||||
- name: Build Docker image
|
||||
run: docker build -t markdownblog .
|
||||
|
||||
- name: Save Docker image as tarball
|
||||
run: docker save markdownblog -o markdownblog-image.tar
|
||||
|
||||
- name: Upload Docker image artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: markdownblog-docker-image
|
||||
path: markdownblog-image.tar
|
||||
|
||||
- name: Push Docker image
|
||||
run: docker push registry.gitea.com/user/markdownblog:latest
|
||||
run: docker push 10.0.0.13:3002/rattatwinko/markdownblog:latest
|
||||
|
||||
- name: Deploy to Gitea
|
||||
@@ -584,11 +584,31 @@ export default function AdminPage() {
|
||||
</div>
|
||||
)}
|
||||
<button
|
||||
onClick={handleExportTarball}
|
||||
onClick={() => {
|
||||
if (isDocker) {
|
||||
// Custom popup for Docker support message
|
||||
const dockerSupportPopup = document.createElement('div');
|
||||
dockerSupportPopup.innerHTML = 'Exporting from Docker is not supported yet.';
|
||||
dockerSupportPopup.style.position = 'fixed';
|
||||
dockerSupportPopup.style.top = '50%';
|
||||
dockerSupportPopup.style.left = '50%';
|
||||
dockerSupportPopup.style.transform = 'translate(-50%, -50%)';
|
||||
dockerSupportPopup.style.backgroundColor = 'white';
|
||||
dockerSupportPopup.style.padding = '20px';
|
||||
dockerSupportPopup.style.borderRadius = '5px';
|
||||
dockerSupportPopup.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.2)';
|
||||
dockerSupportPopup.style.zIndex = '1000';
|
||||
document.body.appendChild(dockerSupportPopup);
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(dockerSupportPopup);
|
||||
}, 3000);
|
||||
} else {
|
||||
handleExportTarball();
|
||||
}
|
||||
}}
|
||||
className="px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700"
|
||||
title="Export the entire root folder as a tarball"
|
||||
>
|
||||
Export Root as Tarball
|
||||
Export Posts
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user