Skip to content

Commit

Permalink
Atualizando html e add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoallmeida committed Jan 21, 2024
1 parent 728d12a commit 0823e75
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 8 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This GitHub Action demonstrates building a Docker image,
# pushing it to Docker Hub, and creating a Render build
# preview with every push to the main branch.
#
# This Action requires setting the following secrets:
#
# - DOCKERHUB_USERNAME
# - DOCKERHUB_ACCESS_TOKEN (create in Docker Hub)
# - RENDER_API_KEY (create from the Account Settings page)
# - RENDER_SERVICE_ID (the service to create a preview for)
#
# You must also set env.DOCKERHUB_REPOSITORY_URL below.
#
# Remember to delete previews when you're done with them!
# You can do this from the Render Dashboard or via the
# Render API.

name: Preview Docker Image on Render
# Fires whenever commits are pushed to the main branch
# (including when a PR is merged)
on:
push:
branches: [ "main" ]
env:
# Replace with the URL for your image's repository
DOCKERHUB_REPOSITORY_URL: https://hub.docker.com/repository/docker/joaoallmeida/calculadora-fiis
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Build the Docker image
run: docker build . --file Dockerfile --tag $DOCKERHUB_REPOSITORY_URL:$(date +%s)

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Docker Metadata action
uses: docker/[email protected]
id: meta
with:
images: ${{env.DOCKERHUB_REPOSITORY_URL}}

- name: Build and push Docker image
uses: docker/[email protected]
id: build
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Create Render service preview
uses: fjogeleit/http-request-action@v1
with:
# Render API endpoint for creating a service preview
url: 'https://api.render.com/v1/services/${{ secrets.RENDER_SERVICE_ID }}/preview'
method: 'POST'

# All Render API requests require a valid API key.
bearerToken: ${{ secrets.RENDER_API_KEY }}

# Here we specify the digest of the image we just
# built. You can alternatively provide the image's
# tag (main) instead of a digest.
data: '{"imagePath": "${{ env.DOCKERHUB_REPOSITORY_URL }}@${{ steps.build.outputs.digest }}"}'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ __pycache__/

# C extensions
*.so
*ini

# Distribution / packaging
.Python
Expand Down
13 changes: 5 additions & 8 deletions app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="../static/style.css">
<link rel="icon" href="../static/img/icons8-prédio-96.png">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/3.2.6/jquery.inputmask.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-maskmoney/3.0.2/jquery.maskMoney.min.js"></script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.js"></script>
<script type='text/javascript'>
$(function() {
$('#value_invested').maskMoney({
decimal: ".",
thousands: ","
});
$(document).ready(function(){
$('#value_invested').mask("#,##0.00", {reverse: true});
});
</script>
</head>
Expand Down

0 comments on commit 0823e75

Please sign in to comment.